-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (53 loc) · 2.1 KB
/
deploy-dataflow-flex-template.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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@v4
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Build flex templates
id: build_flex_template
run: echo "BUILD_TAG=$(./build_flex_template.sh | tail -1)" >> $GITHUB_OUTPUT
shell: bash
- name: Check BUILD_TAG
# Fail the run if the BUILD_TAG is empty
if: ${{ steps.build_flex_template.outputs.BUILD_TAG == '' }}
run: exit 1
- 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@v6
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 }}
If this is the only change, and it has not accidently blanked this out, then you can safely merge this to use the latest build on the next run.
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 }}"