Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
976 B
1
Indexable
Never
name: CD pipeline

on:
  push:
    branches:
      - main

jobs:
  deploy:
    env:
	  REACT_APP_API_BASE=/api/v1
	  PORT=3001
	  REACT_APP_API_GET_TEXT=/extract
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Build and push Docker images
        run: |
          docker build -t rastokopal/fact-checking-fe:latest .
          echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
          docker push rastokopal/fact-checking-fe:latest

      - name: SSH and deploy
        uses: appleboy/ssh-action@master
        with:
          host: ${{ secrets.SERVER_HOST }}
          username: ${{ secrets.SERVER_USERNAME }}
          key: ${{ secrets.SERVER_SSH_KEY }}
          script: |
            docker pull rastokopal/fact-checking-fe:latest
            cd ${{ secrets.DEPLOY_FOLDER }}
            docker-compose up -d --no-deps nginx