resolve merge conflicts #115
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: Build and Push Images to GitHub Container Registry | |
| on: | |
| push: | |
| branches: | |
| - develop-saas | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| environment: Build | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Extract version tag | |
| run: | | |
| RAW_TAG="${GITHUB_REF##*/}" # v1.1-saas | |
| CLEAN_TAG="${RAW_TAG%-saas}" # v1.1 | |
| echo "TAG=$CLEAN_TAG" >> $GITHUB_ENV | |
| - name: Debug GitHub Token Access | |
| run: | | |
| if [ -z "${{ secrets.GITHUB_TOKEN }}" ]; then | |
| echo "GITHUB_TOKEN is NOT available" | |
| exit 1 | |
| else | |
| echo "GITHUB_TOKEN is available" | |
| fi | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Verify Google Client ID Secret | |
| run: | | |
| if [ -z "${{ secrets.GOOGLE_CLIENT_ID }}" ]; then | |
| echo "GOOGLE_CLIENT_ID secret is NOT available" | |
| exit 1 | |
| fi | |
| - name: Build and push Clients image | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: . | |
| file: ./Clients/Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| ghcr.io/${{ github.repository_owner }}/verifywise-frontend-saas:test | |
| build-args: | | |
| VITE_GOOGLE_CLIENT_ID=${{ secrets.GOOGLE_CLIENT_ID }} | |
| VITE_SLACK_CLIENT_ID=${{ secrets.SLACK_CLIENT_ID }} | |
| VITE_APP_VERSION=${{ env.TAG }} | |
| VITE_BRANDFETCH_API_KEY=${{ secrets.VITE_BRANDFETCH_API_KEY }} | |
| - name: Build and push Servers image | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: ./Servers | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| ghcr.io/${{ github.repository_owner }}/verifywise-backend-saas:test | |
| - name: Clean up after Servers build | |
| run: | | |
| docker system prune -f | |
| docker builder prune -f | |
| - name: Check disk space | |
| run: df . -h | |
| - name: Remove unnecessary files | |
| run: | | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
| - name: Build and push EvalServer image | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: ./EvalServer | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| ghcr.io/${{ github.repository_owner }}/verifywise-eval-server-saas:test | |
| - name: Deploy to Testing | |
| uses: appleboy/ssh-action@v0.1.5 | |
| with: | |
| host: ${{ secrets.TEST_HOST }} | |
| username: ${{ secrets.TEST_USER }} | |
| key: ${{ secrets.TEST_SSH_KEY }} | |
| script: | | |
| cd /root/verifywise/_saas_deployment | |
| docker-compose --env-file .env.prod down | |
| docker images --format "table {{.Repository}}:{{.Tag}}\t{{.ID}}" | grep -v -E "(redis|postgres|admin)" | awk 'NR>1 {print $2}' | xargs -r docker rmi -f || true | |
| ./install.sh |