Deploy Dataflow Flex Template #27
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: Deploy Dataflow Flex Template | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- "**.py" | |
- "cloudbuild.yaml" | |
- "Dockerfile" | |
- "flex_template_metadata_*.json" | |
- "requirements.txt" | |
jobs: | |
deploy: | |
name: Deploy Dataflow Flex Template | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- id: 'auth' | |
name: 'Authenticate to Google Cloud' | |
uses: 'google-github-actions/auth@v1' | |
with: | |
credentials_json: '${{ secrets.GCP_SA_KEY }}' | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v1 | |
- name: Build flex templates | |
id: build_flex_template | |
run: echo "BUILD_TAG=$(./build_flex_template.sh | tail -1)" >> $GITHUB_OUTPUT | |
shell: bash | |
- name: Update Cloud Workflow build tag | |
# yamllint disable rule:line-length | |
run: sed -ri 's/^(\s*-\sflexTemplateBuildTag:)(\s".*"$)/\1 "${{ steps.build_flex_template.outputs.BUILD_TAG }}"/' data-pipeline.workflows.yaml | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
add-paths: | | |
data-pipeline.workflows.yaml | |
branch-suffix: timestamp | |
commit-message: Bump dataflow flex template build tag | |
title: Bump dataflow flex template build tag | |
body: | | |
Bump dataflow flex template build tag to: ${{ steps.build_flex_template.outputs.BUILD_TAG }} | |
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action | |
- name: Check outputs | |
run: | | |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" | |
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" | |