-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (55 loc) · 1.7 KB
/
workflow.yaml
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
name: Github Actions Workload Identity Federation
'on':
push:
branches:
- main
pull_request:
branches: main
jobs:
print:
runs-on: ubuntu-latest
environment: dev # Fetches the env variables for dev
permissions:
id-token: write
steps:
- name: Checkout actions-oidc-debugger
uses: actions/checkout@v3
with:
repository: github/actions-oidc-debugger
ref: main
token: '${{ secrets.GITHUB_TOKEN }}'
path: ./.github/actions/actions-oidc-debugger
- name: Debug OIDC Claims
uses: ./.github/actions/actions-oidc-debugger
with:
audience: '${{ vars.WORKLOAD_IDENTITY_POOL }}'
build:
runs-on: ubuntu-latest
environment: dev # Fetches the env variables for dev
permissions:
contents: read
id-token: write
steps:
- name: Checkout actions-oidc-debugger
uses: actions/checkout@v3
- id: auth
name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
create_credentials_file: true
workload_identity_provider: '${{ vars.WORKLOAD_IDENTITY_PROVIDER }}'
service_account: '${{ secrets.SERVICE_ACCOUNT }}'
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: set credentials file
run: >-
gcloud auth login
--cred-file=${{steps.auth.outputs.credentials_file_path}}
- name: Use gcloud CLI
run: gcloud info
- id: upload-file
uses: google-github-actions/upload-cloud-storage@v2
with:
path: CHANGELOG.md
destination: mahendran-data-proc-input-data/
process_gcloudignore: false