ff-prod deploys (and less code) #297
Workflow file for this run
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: Faucet API | |
on: | |
pull_request: | |
paths: | |
- 'faucet-api/**' | |
- '.github/workflows/faucet-api.yml' | |
- '.github/actions/deploy-gfunction' | |
- '.github/actions/build-function' | |
workflow_call: | |
inputs: | |
deploy_env: | |
type: string | |
required: false | |
env: | |
app_name: faucet-api | |
function_handler: faucet | |
concurrency: | |
group: 'faucet-api--${{ inputs.deploy_env || github.event.inputs.deploy_env }}@${{ github.event.name }}${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
cancel-in-progress: true | |
jobs: | |
build-faucet: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: faucet-api | |
steps: | |
- name: Checkout | |
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 | |
- name: prepare env logic | |
id: prepare | |
uses: ./.github/actions/prepare-deploy | |
with: | |
app_base_name: ${{ env.app_name }} | |
deploy_to: ${{ env.deploy_to }} | |
- name: build function | |
uses: ./.github/actions/build-function | |
with: | |
app_name: ${{ env.app_name }} | |
outputs: | |
gh_env: ${{ steps.prepare.outputs.gh_env }} | |
function_name: ${{ steps.prepare.outputs.function_name }} | |
deploy-faucet: | |
# if: ${{ inputs.deploy_env == 'demo' }} || ${{ inputs.deploy_env == 'development' }} | |
# For now deploy only to demo | |
if: ${{ inputs.deploy_env == 'demo' }} | |
concurrency: | |
group: deploy-${{ needs.build-faucet.outputs.function_name }} | |
cancel-in-progress: false | |
needs: build-faucet | |
runs-on: ubuntu-latest | |
environment: ${{ needs.build-faucet.outputs.gh_env }} | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 | |
with: | |
path: apps | |
- name: Deploy Gfunction | |
id: functionsdeploy | |
uses: ./apps/.github/actions/deploy-gfunction | |
with: | |
app_name: ${{ env.app_name }} | |
GWIP: ${{ secrets.GWIP }} | |
GSA: ${{ secrets.GSA }} | |
target: ${{ env.function_handler }} | |
gcloud_region: ${{ vars.GCLOUD_REGION }} | |
service_account: '${{ vars.FIRESTORE_SA }}' | |
deploy_env: ${{ inputs.deploy_env }} |