1
0
Fork 0
mirror of https://github.com/imjasonh/kontain.me synced 2026-07-16 12:21:53 +00:00

deploy using terraform

- remove some apps (cowsay, transparency, estargz)
- start to move DNS zone management into TF too (optional)
- update GH workflow to deploy using TF

TODO:
- store state in GCS
- define one-time setup to grant GHA SA permissions it needs to deploy
- documentation for Future Jason
- cosign_verify base images
- cosign_sign images and cosign_verify before deploy
This commit is contained in:
Jason Hall 2023-04-25 10:52:58 -04:00
parent 2e1f107239
commit d194a4f550
Failed to extract signature
29 changed files with 559 additions and 1721 deletions

View file

@ -14,16 +14,15 @@ jobs:
permissions:
id-token: write
contents: read
env:
KO_DOCKER_REPO=gcr.io/kontaindotme
steps:
- uses: actions/checkout@v3
# Install tools.
- uses: actions/setup-go@v2
with:
go-version: 1.18
- uses: imjasonh/setup-ko@v0.6
env:
KO_DOCKER_REPO: gcr.io/kontaindotme
go-version: 1.20.x
- uses: hashicorp/setup-terraform@v2
- uses: imjasonh/setup-crane@v0.1
# Setup OIDC->SA auth
@ -35,11 +34,20 @@ jobs:
- uses: google-github-actions/setup-gcloud@v0.6.0
with:
project_id: kontaindotme
install_components: beta
# Deploy and test.
- run: ./deploy.sh
env:
KOCACHE: ~/ko
- name: Terraform Plan
run: |
cat > terraform.tfvars <<EOF
project_id = "${{ env.PROJECT_ID }}"
EOF
terraform init
terraform plan -input=false -lock=false -out=plan.tmp
terraform show -no-color plan.tmp
- name: Terraform Apply
if: ${{ github.event_name == 'push' }}
run: terraform apply -auto-approve -input=false plan.tmp
- run: ./test.sh