Deploy Python Firebase Functions #8
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 Python Firebase Functions | |
| on: | |
| push: | |
| branches: | |
| - add-deploy-workflow | |
| workflow_dispatch: | |
| inputs: | |
| environment: | |
| description: 'Environment to deploy to' | |
| required: true | |
| default: 'staging' | |
| type: choice | |
| options: | |
| - staging | |
| - prod | |
| confirm_prod: | |
| description: 'Type "yes" to confirm production deployment' | |
| required: false | |
| type: string | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: deploy-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Validate production deployment | |
| if: ${{ github.event.inputs.environment == 'prod' }} | |
| run: | | |
| if [[ "${{ github.event.inputs.confirm_prod }}" != "yes" ]]; then | |
| echo "::error::Production deployment requires explicit confirmation. Please type 'yes' in the confirm_prod field." | |
| exit 1 | |
| fi | |
| - name: Deploy Firebase Functions | |
| uses: ./ | |
| with: | |
| environment: ${{ github.event.inputs.environment }} | |
| project_id: ${{ github.event.inputs.environment == 'prod' && 'hello-wisdom-prod' || 'hello-wisdom-staging' }} |