Skip to content

Commit

Permalink
only pass some flags via flag file
Browse files Browse the repository at this point in the history
  • Loading branch information
cru-Luis-Rodriguez committed Oct 25, 2024
1 parent f44ac4c commit 7997c58
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/build-deploy-cloudrun-function.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,19 @@ jobs:
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2

- name: Construct Config File
id: construct-config
run: |
sed -e 's|FUNCTION_NAME|"${{ inputs.function_name }}-${{ needs.build.outputs.build-number }}"|g' function_config_template.json > function_config.json
- name: Verify Config File
run: cat function_config.json

# Step 4: Deploy the Cloud Function using gcloud
- name: Deploy to Cloud Run Functions
id: deploy
env:
GCP_REGION: ${{ secrets.GCP_REGION }}
run: |
gcloud config set project ${{ secrets.GCP_PROJECT_ID }}
gcloud functions deploy --flags-file=function_config.json
gcloud functions deploy ${{ inputs.function_name }}-${{ needs.build.outputs.build-number }} \
--flags-file=function_config.json \
--no-allow-unauthenticated \
--region $GCP_REGION \
--build-service-account=projects/${{ secrets.GCP_PROJECT_ID }}/serviceAccounts/${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }} \
--run-service-account=${{ secrets.RUN_SERVICE_ACCOUNT }}
# Step 5: Post a comment on the pull request if it is merged
- uses: actions/github-script@v6
Expand Down

0 comments on commit 7997c58

Please sign in to comment.