mirror of
https://github.com/imjasonh/kontain.me
synced 2026-07-08 09:04:54 +00:00
Add deploy.yaml to deploy using OIDC and federated Workload Identity
This commit is contained in:
parent
1f766ba9d2
commit
9efb73f210
1 changed files with 33 additions and 0 deletions
33
.github/workflows/deploy.yaml
vendored
Normal file
33
.github/workflows/deploy.yaml
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
name: Deploy
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 1 * * *' # 1AM UTC; 9PM Eastern
|
||||
push:
|
||||
branches: ['main']
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy
|
||||
runs-on: ['ubuntu-latest']
|
||||
steps:
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.17.x
|
||||
- uses: actions/checkout@v2
|
||||
- uses: imjasonh/setup-ko@v0.4
|
||||
- uses: 'google-github-actions/setup-gcloud@v0.2.1'
|
||||
with:
|
||||
project_id: 'kontaindotme'
|
||||
|
||||
- uses: 'google-github-actions/auth@v0.3.0'
|
||||
id: auth
|
||||
with:
|
||||
token_format: 'id_token'
|
||||
workload_identity_provider: 'projects/7577580991/locations/global/workloadIdentityPools/gha-pool/providers/gha-provider'
|
||||
service_account: 'gha-deployer@kontaindotme.iam.gserviceaccount.com'
|
||||
create_credentials_file: true
|
||||
- run: gcloud auth login --brief --cred-file="${{ steps.auth.outputs.credentials_file_path }}"
|
||||
|
||||
- run: ./deploy.sh
|
||||
Loading…
Add table
Add a link
Reference in a new issue