From 119be59e7691262d6fb87a43f5d456c32eb3c2b9 Mon Sep 17 00:00:00 2001 From: Julien Marcil Date: Thu, 15 Jan 2026 21:22:03 -0500 Subject: [PATCH] feat: add valian fireway workflow --- .github/workflows/valian-fireway.yml | 74 ++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/valian-fireway.yml diff --git a/.github/workflows/valian-fireway.yml b/.github/workflows/valian-fireway.yml new file mode 100644 index 0000000..2881a90 --- /dev/null +++ b/.github/workflows/valian-fireway.yml @@ -0,0 +1,74 @@ +name: fireway migrate + +on: + workflow_call: + inputs: + workload-identity-project-number: + description: the GCP project number used for Workload Identity Federation + required: true + type: string + gcp-project-id: + description: The firebase project environment used for the deployment + required: true + type: string + gcp-service-account: + description: the email address of the service account + required: true + type: string + working-directory: + description: The working directory of the firebase project + required: false + type: string + default: functions + dry-run: + description: run migrations in dry-run mode + type: boolean + required: false + default: false + slack-channel-id: + description: Slack channel id to send alerts to + type: string + required: false + +jobs: + fireway: + name: fireway + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + concurrency: + group: fireway-migrate-${{ inputs.gcp-project-id }} + steps: + - uses: actions/checkout@v6 + - name: setup pnpm + uses: valian-ca/github-workflows/.github/actions/setup-pnpm@main + - uses: valian-ca/github-workflows/.github/actions/gcp-github-auth@main + with: + workload-identity-project-number: ${{ inputs.workload-identity-project-number }} + gcp-service-account: ${{ inputs.gcp-service-account }} + + - uses: google-github-actions/setup-gcloud@v3 + with: + project_id: ${{ inputs.gcp-project-id }} + + - name: configure firebase environment + run: npx firebase use ${{ inputs.gcp-project-id }} + working-directory: ${{ inputs.working-directory }} + + - name: run migrations ${{ inputs.dry-run && 'in dry run mode' || '' }} + env: + GCLOUD_PROJECT: ${{ inputs.gcp-project-id }} + run: npx @valian/fireway migrate ${{ inputs.dry-run && '--dryRun' || '' }} + working-directory: ${{ inputs.working-directory }} + + - name: notify Slack of failure + id: slack + if: ${{ !success() && inputs.slack-channel-id != '' }} + uses: valian-ca/github-workflows/.github/actions/slack-alert@main + with: + message: fireway migrate ${{ inputs.gcp-project-id }} error + mrkdwn: | + :warning: fireway migrate *${{ inputs.gcp-project-id }}* (`${{ job.status }}`) + token: ${{ secrets.SLACK_BOT_TOKEN }} + channel: ${{ inputs.slack-channel-id }}