fix: handle missing tenant by showing common home page #29
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: Promise Tracker | Deploy | Dev | |
| on: | |
| push: | |
| branches: [main] | |
| concurrency: | |
| group: "${{ github.workflow }} @ ${{ github.ref }}" | |
| cancel-in-progress: true | |
| env: | |
| APP_NAME: promisetracker-v2 | |
| DOKKU_REMOTE_BRANCH: "master" | |
| DOKKU_REMOTE_URL: "ssh://azureuser@ui-1.dev.codeforafrica.org" | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| IMAGE_NAME: "codeforafrica/promisetracker-v2" | |
| NEXT_PUBLIC_APP_URL: "https://promisetracker-v2.dev.codeforafrica.org" | |
| SENTRY_ENVIRONMENT: "development" | |
| jobs: | |
| deploy: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| node-version: [20.16] | |
| os: [ubuntu-latest] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| # Add support for more platforms with QEMU (optional) | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| - name: Build Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| build-args: | | |
| NEXT_PUBLIC_APP_URL=${{ env.NEXT_PUBLIC_APP_URL }} | |
| NEXT_PUBLIC_SENTRY_DSN=${{ secrets.SENTRY_DSN }} | |
| SENTRY_ENVIRONMENT=${{ env.SENTRY_ENVIRONMENT }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| context: . | |
| platforms: linux/arm64 | |
| push: true | |
| secrets: | | |
| "database_uri=${{ secrets.DATABASE_URI }}" | |
| "payload_secret=${{ secrets.PAYLOAD_SECRET }}" | |
| "sentry_auth_token=${{ secrets.SENTRY_AUTH_TOKEN }}" | |
| "sentry_org=${{ secrets.SENTRY_ORG }}" | |
| "sentry_project=${{ secrets.SENTRY_PROJECT }}" | |
| tags: "${{ env.IMAGE_NAME }}:${{ github.sha }}" | |
| - name: Push to Dokku | |
| uses: dokku/github-action@v1.7.0 | |
| with: | |
| git_remote_url: ${{ env.DOKKU_REMOTE_URL }}/${{ env.APP_NAME }} | |
| ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| deploy_docker_image: ${{ env.IMAGE_NAME }}:${{ github.sha }} |