mirror of
https://github.com/imjasonh/kontain.me
synced 2026-07-08 09:04:54 +00:00
47 lines
1.2 KiB
YAML
47 lines
1.2 KiB
YAML
name: Deploy
|
|
|
|
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 1 * * *' # 1AM UTC; 9PM Eastern
|
|
push:
|
|
branches: ['main']
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
deploy:
|
|
name: Deploy
|
|
runs-on: ['ubuntu-latest']
|
|
permissions:
|
|
id-token: write
|
|
contents: read
|
|
packages: write
|
|
steps:
|
|
# Setup tools
|
|
- uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.17.x
|
|
- uses: actions/checkout@v2
|
|
- uses: imjasonh/setup-ko@v0.4
|
|
env:
|
|
KO_DOCKER_REPO: gcr.io/kontaindotme
|
|
- uses: 'google-github-actions/setup-gcloud@v0.2.1'
|
|
with:
|
|
project_id: kontaindotme
|
|
|
|
# Setup OIDC->SA auth
|
|
- uses: 'google-github-actions/auth@v0.3.0'
|
|
id: auth
|
|
with:
|
|
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
|
|
- name: Login
|
|
run: |
|
|
gcloud auth login --brief --cred-file="${{ steps.auth.outputs.credentials_file_path }}"
|
|
gcloud run services list # check auth; TODO: remove
|
|
|
|
# Test a quick one first. TODO: remove
|
|
- run: ko publish ./cmd/random
|
|
- run: ./deploy.sh
|