name: Build and Deploy Docker images on: push: branches: ['master'] pull_request: branches: ['master'] jobs: build-and-push-dockerfile-image: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3 - name: Log in to Docker Hub # Only login if we are actually going to push if: github.event_name == 'push' uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push Docker image uses: docker/build-push-action@v4 with: context: . file: ./apps/web/Dockerfile # Only push on 'push' event (merge to master), not on 'pull_request' push: ${{ github.event_name == 'push' }} tags: killercf/sgc:latest platforms: linux/amd64 build-args: | PUBLIC_CONVEX_URL=${{ secrets.PUBLIC_CONVEX_URL }} PUBLIC_CONVEX_SITE_URL=${{ secrets.PUBLIC_CONVEX_SITE_URL }}