fix: data audit — resolve all contradictions and inconsistencies #3
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 | |
| on: | |
| push: | |
| branches: [main] | |
| env: | |
| REGISTRY: ghcr.io | |
| REPO: barckcode/tf-mobility | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push frontend | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ./frontend | |
| push: true | |
| tags: ${{ env.REGISTRY }}/${{ env.REPO }}/frontend:latest,${{ env.REGISTRY }}/${{ env.REPO }}/frontend:${{ github.sha }} | |
| - name: Build and push backend | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ./backend | |
| push: true | |
| tags: ${{ env.REGISTRY }}/${{ env.REPO }}/backend:latest,${{ env.REGISTRY }}/${{ env.REPO }}/backend:${{ github.sha }} | |
| - name: Build and push etl | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ./etl | |
| push: true | |
| tags: ${{ env.REGISTRY }}/${{ env.REPO }}/etl:latest,${{ env.REGISTRY }}/${{ env.REPO }}/etl:${{ github.sha }} | |
| - name: Deploy to server | |
| uses: appleboy/ssh-action@v1 | |
| with: | |
| host: ${{ secrets.DEPLOY_HOST }} | |
| username: ${{ secrets.DEPLOY_USER }} | |
| key: ${{ secrets.DEPLOY_SSH_KEY }} | |
| script: | | |
| cd /home/observer/tf-mobility | |
| git pull origin main | |
| docker compose build | |
| docker compose up -d frontend backend | |
| docker image prune -f |