frontend for twitter implemented #27
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 Frontend to Heroku | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "frontend/**" | |
| - ".github/workflows/deploy-frontend.yml" | |
| jobs: | |
| deploy-frontend: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Detect frontend changes | |
| id: changes | |
| uses: dorny/paths-filter@v3 | |
| with: | |
| token: ${{ github.token }} | |
| filters: | | |
| frontend: | |
| - 'frontend/Dockerfile' | |
| - 'frontend/package.json' | |
| - 'frontend/package-lock.json' | |
| - 'frontend/astro.config.mjs' | |
| - 'frontend/src/**' | |
| - 'frontend/public/**' | |
| - 'frontend/vitest.config.ts' | |
| - 'frontend/tsconfig.json' | |
| - name: Install Heroku CLI | |
| run: | | |
| curl https://cli-assets.heroku.com/install.sh | sh | |
| if: steps.changes.outputs.frontend == 'true' | |
| - name: Heroku Container Registry login | |
| env: | |
| HEROKU_EMAIL: ${{ secrets.HEROKU_EMAIL }} | |
| HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | |
| run: | | |
| echo "$HEROKU_API_KEY" | docker login -u "$HEROKU_EMAIL" --password-stdin registry.heroku.com | |
| if: steps.changes.outputs.frontend == 'true' | |
| - name: Build and push (linux/amd64) | |
| env: | |
| HEROKU_FRONTEND_APP: ${{ secrets.HEROKU_FRONTEND_APP }} | |
| PUBLIC_WALLET_CONNECT_PROJECT_ID: ${{ secrets.PUBLIC_WALLET_CONNECT_PROJECT_ID }} | |
| PUBLIC_API_URL: ${{ secrets.PUBLIC_API_URL }} | |
| PUBLIC_BADGE_REGISTRY_ADDRESS: ${{ secrets.PUBLIC_BADGE_REGISTRY_ADDRESS }} | |
| PUBLIC_EAS_CONTRACT_ADDRESS: ${{ secrets.PUBLIC_EAS_CONTRACT_ADDRESS }} | |
| PUBLIC_ACTIVITY_TOKEN_ADDRESS: ${{ secrets.PUBLIC_ACTIVITY_TOKEN_ADDRESS }} | |
| PUBLIC_ATTESTATION_RESOLVER_ADDRESS: ${{ secrets.PUBLIC_ATTESTATION_RESOLVER_ADDRESS }} | |
| PUBLIC_SCHEMA_ID: ${{ secrets.PUBLIC_SCHEMA_ID }} | |
| run: | | |
| DOCKER_BUILDKIT=0 docker build \ | |
| --platform linux/amd64 \ | |
| -t registry.heroku.com/${HEROKU_FRONTEND_APP}/web \ | |
| -f frontend/Dockerfile frontend \ | |
| --build-arg PUBLIC_WALLET_CONNECT_PROJECT_ID="${PUBLIC_WALLET_CONNECT_PROJECT_ID}" \ | |
| --build-arg PUBLIC_API_URL="${PUBLIC_API_URL}" \ | |
| --build-arg PUBLIC_BADGE_REGISTRY_ADDRESS="${PUBLIC_BADGE_REGISTRY_ADDRESS}" \ | |
| --build-arg PUBLIC_EAS_CONTRACT_ADDRESS="${PUBLIC_EAS_CONTRACT_ADDRESS}" \ | |
| --build-arg PUBLIC_ACTIVITY_TOKEN_ADDRESS="${PUBLIC_ACTIVITY_TOKEN_ADDRESS}" \ | |
| --build-arg PUBLIC_SCHEMA_ID="${PUBLIC_SCHEMA_ID}" \ | |
| --build-arg PUBLIC_ATTESTATION_RESOLVER_ADDRESS="${PUBLIC_ATTESTATION_RESOLVER_ADDRESS}" \ | |
| docker push registry.heroku.com/${HEROKU_FRONTEND_APP}/web | |
| if: steps.changes.outputs.frontend == 'true' | |
| - name: Release on Heroku | |
| env: | |
| HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | |
| HEROKU_FRONTEND_APP: ${{ secrets.HEROKU_FRONTEND_APP }} | |
| run: | | |
| heroku container:release web -a "${HEROKU_FRONTEND_APP}" | |
| if: steps.changes.outputs.frontend == 'true' |