-
Notifications
You must be signed in to change notification settings - Fork 463
69 lines (60 loc) · 2.19 KB
/
build-push-cft-devtools.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
58
59
60
61
62
63
64
65
66
67
68
69
name: Build and push new dev tools image
on:
push:
branches:
- "master"
paths:
- "infra/build/**"
- ".github/workflows/build-push-cft-devtools.yml"
env:
PROJECT_ID: ${{ secrets.GCR_PROJECT_ID }}
jobs:
build-push-dev-tools:
name: Build and push new CFT dev tools image
runs-on: ubuntu-latest
if: github.repository == 'GoogleCloudPlatform/cloud-foundation-toolkit'
permissions:
contents: 'read'
id-token: 'write'
issues: 'write'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f' # v2.1.7
with:
workload_identity_provider: '${{ secrets.GCP_WIF_PROVIDER }}'
service_account: '${{ secrets.GCP_WIF_SA_EMAIL }}'
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@6189d56e4096ee891640bb02ac264be376592d6a # v2.1.2
with:
project_id: ${{ env.PROJECT_ID }}
- name: Build
run: |-
gcloud auth configure-docker -q
cd infra/build && make build-image-developer-tools
- name: Filter paths for push
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
src:
- "infra/build/**"
- if: steps.filter.outputs.src == 'true'
name: Push
env:
GITHUB_SHA: ${{ github.sha }}
run: |-
cd infra/build && make release-image-developer-tools
- name: Open issue if push failed
if: ${{ failure() && steps.filter.outputs.src == 'true' }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |-
github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: 'build-push-dev-tools job failed',
body: 'Logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}',
assignees: ['bharathkkb','apeabody']
})