Skip to content

Commit 24274f7

Browse files
authored
Switch secrets to vars where appropriate (#20)
1 parent f601e09 commit 24274f7

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

workflows/create-cloud-deploy-release/cloud-deploy-to-cloud-run.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ jobs:
111111
id: 'auth'
112112
uses: 'google-github-actions/auth@v1'
113113
with:
114-
workload_identity_provider: '${{ secrets.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
115-
service_account: '${{ secrets.WIF_SERVICE_ACCOUNT }}' # e.g. - [email protected]
114+
workload_identity_provider: '${{ vars.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
115+
service_account: '${{ vars.WIF_SERVICE_ACCOUNT }}' # e.g. - [email protected]
116116

117117
- name: 'Set up Cloud SDK'
118118
uses: 'google-github-actions/setup-gcloud@v1'

workflows/deploy-cloudrun/cloudrun-buildpacks.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ env:
6161
REPOSITORY: YOUR_REPOSITORY_NAME # TODO: update Artifact Registry repository name
6262
SERVICE: YOUR_SERVICE_NAME # TODO: update Cloud Run service name
6363
REGION: YOUR_SERVICE_REGION # TODO: update Cloud Run service region
64-
SOURCE_DIRECTORY: YOUR_SOURCE_DIRECTORY #TODO: update source code directory
64+
SOURCE_DIRECTORY: YOUR_SOURCE_DIRECTORY #TODO: update source code directory
6565

6666
jobs:
6767
deploy:
@@ -80,8 +80,8 @@ jobs:
8080
uses: 'google-github-actions/auth@v0'
8181
with:
8282
token_format: 'access_token'
83-
workload_identity_provider: '${{ secrets.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
84-
service_account: '${{ secrets.WIF_SERVICE_ACCOUNT }}' # e.g. - [email protected]
83+
workload_identity_provider: '${{ vars.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
84+
service_account: '${{ vars.WIF_SERVICE_ACCOUNT }}' # e.g. - [email protected]
8585

8686
# NOTE: Alternative option - authentication via credentials json
8787
# - name: Google Auth
@@ -100,7 +100,7 @@ jobs:
100100
username: 'oauth2accesstoken'
101101
password: '${{ steps.auth.outputs.access_token }}'
102102
registry: '${{ env.GAR_LOCATION }}-docker.pkg.dev'
103-
103+
104104
# NOTE: Alternative option - authentication via credentials json
105105
# - name: Docker Auth
106106
# id: docker-auth
@@ -110,7 +110,7 @@ jobs:
110110
# username: _json_key
111111
# password: ${{ secrets.GCP_CREDENTIALS }}
112112

113-
# BEGIN - Pack download, build and publish
113+
# BEGIN - Pack download, build and publish
114114

115115
# Build and publish image to Artifact Registry
116116
- name: Build and Publish with Buildpacks

workflows/deploy-cloudrun/cloudrun-declarative.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ jobs:
7676
uses: 'google-github-actions/auth@v0'
7777
with:
7878
token_format: 'access_token'
79-
workload_identity_provider: '${{ secrets.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
80-
service_account: '${{ secrets.WIF_SERVICE_ACCOUNT }}' # e.g. - [email protected]
79+
workload_identity_provider: '${{ vars.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
80+
service_account: '${{ vars.WIF_SERVICE_ACCOUNT }}' # e.g. - [email protected]
8181

8282
# NOTE: Alternative option - authentication via credentials json
8383
# - name: Google Auth
@@ -106,7 +106,7 @@ jobs:
106106

107107
# Create Cloud Run YAML Service specification from template
108108
# envsubst is replacing template variables and creating a YAML Service specification with the new image tag
109-
- name: Create Service declearation
109+
- name: Create Service declearation
110110
run: |-
111111
export IMAGE="${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.SERVICE }}:${{ github.sha }}"
112112
export SERVICE="${{ env.SERVICE }}"

workflows/deploy-cloudrun/cloudrun-docker.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ jobs:
7676
uses: 'google-github-actions/auth@v0'
7777
with:
7878
token_format: 'access_token'
79-
workload_identity_provider: '${{ secrets.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
80-
service_account: '${{ secrets.WIF_SERVICE_ACCOUNT }}' # e.g. - [email protected]
79+
workload_identity_provider: '${{ vars.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
80+
service_account: '${{ vars.WIF_SERVICE_ACCOUNT }}' # e.g. - [email protected]
8181

8282
# NOTE: Alternative option - authentication via credentials json
8383
# - name: Google Auth
@@ -97,7 +97,7 @@ jobs:
9797
username: 'oauth2accesstoken'
9898
password: '${{ steps.auth.outputs.access_token }}'
9999
registry: '${{ env.GAR_LOCATION }}-docker.pkg.dev'
100-
100+
101101
# NOTE: Alternative option - authentication via credentials json
102102
# - name: Docker Auth
103103
# id: docker-auth

workflows/deploy-cloudrun/cloudrun-source.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ jobs:
7272
id: auth
7373
uses: 'google-github-actions/auth@v0'
7474
with:
75-
workload_identity_provider: '${{ secrets.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
76-
service_account: '${{ secrets.WIF_SERVICE_ACCOUNT }}' # e.g. - [email protected]
75+
workload_identity_provider: '${{ vars.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
76+
service_account: '${{ vars.WIF_SERVICE_ACCOUNT }}' # e.g. - [email protected]
7777

7878
# NOTE: Alternative option - authentication via credentials json
7979
# - name: Google Auth

0 commit comments

Comments
 (0)