Merge pull request #3088 from bluewave-labs/fix-traslator-error #554
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: Staging deploy | |
| on: | |
| push: | |
| branches: ["develop"] | |
| jobs: | |
| docker-build-and-push-client: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Get version | |
| id: vars | |
| run: echo "VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV | |
| - name: Build Client Docker image | |
| run: | | |
| docker build \ | |
| -t ghcr.io/bluewave-labs/checkmate:frontend-staging \ | |
| -f ./docker/staging/client.Dockerfile \ | |
| --label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \ | |
| --build-arg VITE_APP_VERSION=${{ env.VERSION }} \ | |
| . | |
| - name: Push Client Docker image | |
| run: docker push ghcr.io/bluewave-labs/checkmate:frontend-staging | |
| docker-build-and-push-server: | |
| needs: docker-build-and-push-client | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build Server Docker image | |
| run: | | |
| docker build \ | |
| -t ghcr.io/bluewave-labs/checkmate:backend-staging \ | |
| -f ./docker/staging/server.Dockerfile \ | |
| --label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \ | |
| . | |
| - name: Push Server Docker image | |
| run: docker push ghcr.io/bluewave-labs/checkmate:backend-staging | |
| - name: Build Mongo Docker image | |
| run: | | |
| docker build \ | |
| -t ghcr.io/bluewave-labs/checkmate:mongo-staging \ | |
| -f ./docker/staging/mongoDB.Dockerfile \ | |
| --label org.opencontainers.image.source=https://github.com/bluewave-labs/checkmate \ | |
| . | |
| - name: Push MongoDB Docker image | |
| run: docker push ghcr.io/bluewave-labs/checkmate:mongo-staging | |
| deploy-to-staging: | |
| needs: docker-build-and-push-server | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: SSH into server and restart container using Docker Compose | |
| uses: appleboy/ssh-action@v1.2.2 | |
| with: | |
| host: ${{ secrets.STAGING_SERVER_HOST }} | |
| username: ${{ secrets.STAGING_SERVER_USER }} | |
| key: ${{ secrets.STAGING_SERVER_SSH_KEY }} | |
| script: | | |
| cd checkmate | |
| git pull | |
| cd docker/staging | |
| docker compose down | |
| docker compose pull | |
| docker compose up -d | |
| docker system prune -af |