Fixing axios #21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy the frontend | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the code | |
| uses: actions/checkout@v2 | |
| - name: Docker login | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build and push to DockerHub | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: . | |
| file: ./docker/Dockerfile.frontend | |
| build-args: | | |
| DATABASE_URL=${{ secrets.DATABASE_URL }} | |
| NEXT_PUBLIC_HTTP_URL=${{ secrets.NEXT_PUBLIC_HTTP_URL }} | |
| NEXT_PUBLIC_WS_URL=${{ secrets.NEXT_PUBLIC_WS_URL }} | |
| push: true | |
| tags: harshitbreaksprod/meetdraw-fe:${{ github.sha }} | |
| - name: Push to VM | |
| run: | | |
| echo "${{ secrets.SSH_PRIVATE_KEY_DIGITAL_OCEAN }}" &> ~/ssh_key | |
| mkdir ~/.ssh | |
| chmod 700 ~/ssh_key | |
| ssh -o StrictHostKeyChecking=no -i ~/ssh_key root@${{ secrets.DIGITAL_OCEAN_SSH_IP }} -t "docker pull harshitbreaksprod/meetdraw-fe:${{ github.sha }} && docker stop meetdraw_fe && docker rm meetdraw_fe && docker run --name meetdraw_fe -e NEXT_PUBLIC_WS_URL=${{ secrets.NEXT_PUBLIC_WS_URL }} -e NEXT_PUBLIC_HTTP_URL=${{ secrets.NEXT_PUBLIC_HTTP_URL }} -d -p 3000:3000 harshitbreaksprod/meetdraw-fe:${{ github.sha }}" |