Firebase Deploy Prod #18
This file contains 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: Firebase Deploy Prod | |
on: | |
workflow_dispatch: | |
release: | |
types: | |
- published | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-Prod | |
cancel-in-progress: true | |
jobs: | |
deploy: | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
permissions: # for KoheiKanagu/composite-actions/setup-firebase-cli@main | |
id-token: write | |
contents: read | |
steps: | |
### Setup ### | |
- uses: actions/checkout@v4 | |
- name: Setup Flutter | |
uses: KoheiKanagu/composite-actions/setup-flutter@main | |
- name: Setup Firebase CLI | |
uses: KoheiKanagu/composite-actions/setup-firebase-cli@main | |
with: | |
workload_identity_provider: ${{ vars.WORKLOAD_IDENTITY_PROVIDER_PROD }} | |
service_account: ${{ vars.SERVICE_ACCOUNT_PROD }} | |
- run: | | |
firebase use prod --debug | |
- name: Install dependencies | |
run: npm ci | |
working-directory: firebase/functions | |
- name: Replace remoteconfig template conditions | |
run: | | |
dart pub get | |
dart run grinder replace-remoteconfig-template-conditions | |
### Deploy ### | |
- name: Deploy Mail Templates | |
working-directory: firebase/functions | |
run: | | |
# https://github.com/firebase/firebase-admin-node/issues/1377 | |
# Workaround for the issue above | |
echo ${{ secrets.FIREBASE_ADMIN_SDK_SERVICE_ACCOUNT_PROD }} | base64 --decode > service-account.json | |
# GOOGLE_APPLICATION_CREDENTIALS is only used in the current shell | |
export GOOGLE_APPLICATION_CREDENTIALS=$GITHUB_WORKSPACE/firebase/functions/service-account.json | |
npx ts-node scripts/set-mail-templates.ts --force | |
- name: Firebase Deploy | |
run: | | |
firebase deploy --force --except extensions | |
### Cleanup ### | |
- name: Cleanup | |
if: always() | |
run: | | |
rm -f service-account.json |