⚡ Cache Android NDK and Gradle wrapper in CI #1442
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: | |
| workflow_dispatch: | |
| inputs: | |
| force_deploy: | |
| description: 'Force the deployment (even if no file changes)' | |
| required: true | |
| type: boolean | |
| default: false | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| env: | |
| CI: true | |
| permissions: | |
| id-token: write | |
| contents: write | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| deploy: | |
| name: Deployment | |
| runs-on: 'ubuntu-latest' | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - uses: oven-sh/setup-bun@v2 | |
| - name: Setup SST Cache | |
| id: sst-caching | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .sst/platform/ | |
| .sst/provider-lock.json | |
| .sst/esbuild.json | |
| # Bump v2 when Pulumi/SST updates require cache invalidation | |
| key: ${{ runner.os }}-sst-v2-${{ hashFiles('./sst.config.ts') }} | |
| restore-keys: ${{ runner.os }}-sst-v2- | |
| - uses: dorny/paths-filter@v3 | |
| name: Check changes | |
| id: changes | |
| with: | |
| base: ${{ github.ref }} | |
| list-files: 'shell' | |
| filters: | | |
| deployRequired: | |
| - 'apps/**' | |
| - 'packages/**' | |
| - 'example/**' | |
| - 'services/**' | |
| - 'infra/**' | |
| example: | |
| - 'example/**' | |
| - 'packages/**' | |
| - 'infra/**' | |
| apps: | |
| - 'apps/**' | |
| - 'packages/**' | |
| - 'infra/**' | |
| services: | |
| - 'apps/wallet/**' | |
| - 'apps/listener/**' | |
| - 'apps/business/**' | |
| - 'packages/wallet-shared/**' | |
| - 'services/**' | |
| - 'packages/**' | |
| - 'infra/**' | |
| - name: "🔨 Install dependencies" | |
| if: steps.changes.outputs.deployRequired == 'true' || github.event.inputs.force_deploy == 'true' | |
| run: bun install --frozen-lockfile | |
| - name: "🔨 Build the SDK" | |
| if: steps.changes.outputs.deployRequired == 'true' || github.event.inputs.force_deploy == 'true' | |
| run: bun run build:sdk | |
| - name: "👥 Configure AWS Credentials" | |
| if: steps.changes.outputs.deployRequired == 'true' || github.event.inputs.force_deploy == 'true' | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: arn:aws:iam::262732185023:role/github-action-deploy-role | |
| aws-region: eu-west-1 | |
| retry-max-attempts: 5 | |
| - name: "👥 Login to Google Cloud" | |
| uses: 'google-github-actions/auth@v2' | |
| if: steps.changes.outputs.services == 'true' || github.event.inputs.force_deploy == 'true' | |
| id: 'auth' | |
| with: | |
| workload_identity_provider: 'projects/426208135260/locations/global/workloadIdentityPools/github/providers/sst-deployer' | |
| service_account: 'sst-service-account@frak-main-v1.iam.gserviceaccount.com' | |
| project_id: 'frak-main-v1' | |
| - name: 'Set up Cloud SDK' | |
| uses: 'google-github-actions/setup-gcloud@v2' | |
| if: steps.changes.outputs.services == 'true' || github.event.inputs.force_deploy == 'true' | |
| with: | |
| project_id: 'frak-main-v1' | |
| install_components: 'kubectl,gke-gcloud-auth-plugin' | |
| - name: 'Docker and k8s Auth' | |
| if: steps.changes.outputs.services == 'true' || github.event.inputs.force_deploy == 'true' | |
| run: | | |
| gcloud auth configure-docker europe-west1-docker.pkg.dev | |
| gcloud container clusters get-credentials master-cluster --location europe-west1-b --project frak-main-v1 | |
| - name: "🔧 Setup environment" | |
| if: steps.changes.outputs.deployRequired == 'true' || github.event.inputs.force_deploy == 'true' | |
| shell: bash | |
| run: | | |
| echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
| if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then | |
| echo "STAGE=prod" >> $GITHUB_ENV | |
| else | |
| echo "STAGE=dev" >> $GITHUB_ENV | |
| fi | |
| echo "Deployment stage : ${{ env.STAGE }}" | |
| - name: "🚀 Deploy Services" | |
| if: steps.changes.outputs.services == 'true' || github.event.inputs.force_deploy == 'true' | |
| run: | | |
| if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then | |
| bun sst deploy --stage gcp-production | |
| else | |
| bun sst deploy --stage gcp-staging | |
| fi | |
| env: | |
| STAGE: ${{ env.STAGE }} | |
| - name: "🚀 Deploy Apps" | |
| if: steps.changes.outputs.apps == 'true' || github.event.inputs.force_deploy == 'true' | |
| run: | | |
| if [[ $STAGE == "prod" ]]; then | |
| bun sst deploy --stage prod | |
| else | |
| bun sst deploy --stage dev | |
| fi | |
| env: | |
| STAGE: ${{ env.STAGE }} | |
| - name: "🚀 Deploy Example" | |
| if: steps.changes.outputs.example == 'true' || github.event.inputs.force_deploy == 'true' | |
| run: | | |
| bun sst deploy --stage example | |
| env: | |
| STAGE: ${{ env.STAGE }} |