Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch secrets to vars where appropriate #20

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ jobs:
id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
workload_identity_provider: '${{ secrets.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
service_account: '${{ secrets.WIF_SERVICE_ACCOUNT }}' # e.g. - my-service-account@my-project.iam.gserviceaccount.com
workload_identity_provider: '${{ vars.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
service_account: '${{ vars.WIF_SERVICE_ACCOUNT }}' # e.g. - my-service-account@my-project.iam.gserviceaccount.com

- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
Expand Down
10 changes: 5 additions & 5 deletions workflows/deploy-cloudrun/cloudrun-buildpacks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ env:
REPOSITORY: YOUR_REPOSITORY_NAME # TODO: update Artifact Registry repository name
SERVICE: YOUR_SERVICE_NAME # TODO: update Cloud Run service name
REGION: YOUR_SERVICE_REGION # TODO: update Cloud Run service region
SOURCE_DIRECTORY: YOUR_SOURCE_DIRECTORY #TODO: update source code directory
SOURCE_DIRECTORY: YOUR_SOURCE_DIRECTORY #TODO: update source code directory

jobs:
deploy:
Expand All @@ -80,8 +80,8 @@ jobs:
uses: 'google-github-actions/auth@v0'
with:
token_format: 'access_token'
workload_identity_provider: '${{ secrets.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
service_account: '${{ secrets.WIF_SERVICE_ACCOUNT }}' # e.g. - my-service-account@my-project.iam.gserviceaccount.com
workload_identity_provider: '${{ vars.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
service_account: '${{ vars.WIF_SERVICE_ACCOUNT }}' # e.g. - my-service-account@my-project.iam.gserviceaccount.com

# NOTE: Alternative option - authentication via credentials json
# - name: Google Auth
Expand All @@ -100,7 +100,7 @@ jobs:
username: 'oauth2accesstoken'
password: '${{ steps.auth.outputs.access_token }}'
registry: '${{ env.GAR_LOCATION }}-docker.pkg.dev'

# NOTE: Alternative option - authentication via credentials json
# - name: Docker Auth
# id: docker-auth
Expand All @@ -110,7 +110,7 @@ jobs:
# username: _json_key
# password: ${{ secrets.GCP_CREDENTIALS }}

# BEGIN - Pack download, build and publish
# BEGIN - Pack download, build and publish

# Build and publish image to Artifact Registry
- name: Build and Publish with Buildpacks
Expand Down
6 changes: 3 additions & 3 deletions workflows/deploy-cloudrun/cloudrun-declarative.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ jobs:
uses: 'google-github-actions/auth@v0'
with:
token_format: 'access_token'
workload_identity_provider: '${{ secrets.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
service_account: '${{ secrets.WIF_SERVICE_ACCOUNT }}' # e.g. - my-service-account@my-project.iam.gserviceaccount.com
workload_identity_provider: '${{ vars.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
service_account: '${{ vars.WIF_SERVICE_ACCOUNT }}' # e.g. - my-service-account@my-project.iam.gserviceaccount.com

# NOTE: Alternative option - authentication via credentials json
# - name: Google Auth
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:

# Create Cloud Run YAML Service specification from template
# envsubst is replacing template variables and creating a YAML Service specification with the new image tag
- name: Create Service declearation
- name: Create Service declearation
run: |-
export IMAGE="${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.SERVICE }}:${{ github.sha }}"
export SERVICE="${{ env.SERVICE }}"
Expand Down
6 changes: 3 additions & 3 deletions workflows/deploy-cloudrun/cloudrun-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ jobs:
uses: 'google-github-actions/auth@v0'
with:
token_format: 'access_token'
workload_identity_provider: '${{ secrets.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
service_account: '${{ secrets.WIF_SERVICE_ACCOUNT }}' # e.g. - my-service-account@my-project.iam.gserviceaccount.com
workload_identity_provider: '${{ vars.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
service_account: '${{ vars.WIF_SERVICE_ACCOUNT }}' # e.g. - my-service-account@my-project.iam.gserviceaccount.com

# NOTE: Alternative option - authentication via credentials json
# - name: Google Auth
Expand All @@ -97,7 +97,7 @@ jobs:
username: 'oauth2accesstoken'
password: '${{ steps.auth.outputs.access_token }}'
registry: '${{ env.GAR_LOCATION }}-docker.pkg.dev'

# NOTE: Alternative option - authentication via credentials json
# - name: Docker Auth
# id: docker-auth
Expand Down
4 changes: 2 additions & 2 deletions workflows/deploy-cloudrun/cloudrun-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ jobs:
id: auth
uses: 'google-github-actions/auth@v0'
with:
workload_identity_provider: '${{ secrets.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
service_account: '${{ secrets.WIF_SERVICE_ACCOUNT }}' # e.g. - my-service-account@my-project.iam.gserviceaccount.com
workload_identity_provider: '${{ vars.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
service_account: '${{ vars.WIF_SERVICE_ACCOUNT }}' # e.g. - my-service-account@my-project.iam.gserviceaccount.com

# NOTE: Alternative option - authentication via credentials json
# - name: Google Auth
Expand Down
Loading