fix(ci): use devcontainer image directly for tofu checks

Signed-off-by: Vegard Hagen <[email protected]>
This commit is contained in:
Vegard Hagen
2025-07-14 18:52:39 +02:00
parent 66dad81d84
commit cdea7e1719
3 changed files with 7 additions and 27 deletions
-1
View File
@@ -13,7 +13,6 @@
"username": "homelab" "username": "homelab"
}, },
"ghcr.io/devcontainers/features/github-cli:1": {}, "ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/go:1": {},
"ghcr.io/devcontainers/features/java:1": {}, "ghcr.io/devcontainers/features/java:1": {},
"ghcr.io/devcontainers-extra/features/argo-cd:1": {}, "ghcr.io/devcontainers-extra/features/argo-cd:1": {},
"ghcr.io/devcontainers-extra/features/talosctl:1": {}, "ghcr.io/devcontainers-extra/features/talosctl:1": {},
+2 -2
View File
@@ -3,9 +3,9 @@ name: Build devcontainer
on: on:
push: push:
branches: [ main ] branches: [ main ]
paths: [ ".devcontainer/**" ] paths: [ '.devcontainer/**' ]
schedule: schedule:
- cron: "4 20 28 * *" - cron: '4 20 28 * *'
jobs: jobs:
build: build:
+5 -24
View File
@@ -2,7 +2,7 @@ name: OpenTofu validation
on: on:
push: push:
branches: [ '**' ] branches: [ '**', '!renovate/**' ]
paths: paths:
- '**.tf' - '**.tf'
- '**.tofu' - '**.tofu'
@@ -13,17 +13,14 @@ on:
pull_request_target: pull_request_target:
branches: [ main ] branches: [ main ]
permissions:
packages: write
jobs: jobs:
validate-tofu: tofu-format:
name: Validate name: Validate
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: read contents: read
env: env:
TOFU_DIR: tofu/kubernetes TOFU_DIR: tofu
steps: steps:
- name: Checkout - name: Checkout
@@ -36,23 +33,7 @@ jobs:
username: ${{ github.repository_owner }} username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Tofu init
uses: devcontainers/ci@8bf61b26e9c3a98f69cb6ce2f88d24ff59b785c6 #v0.3.1900000417
with:
cacheFrom: ghcr.io/vehagn/homelab-devcontainer
push: never
runCmd: tofu -chdir=${{ env.TOFU_DIR }} init
- name: Tofu validate
uses: devcontainers/ci@8bf61b26e9c3a98f69cb6ce2f88d24ff59b785c6 #v0.3.1900000417
with:
cacheFrom: ghcr.io/vehagn/homelab-devcontainer
push: never
runCmd: tofu -chdir=${{ env.TOFU_DIR }} validate
- name: Tofu format - name: Tofu format
uses: devcontainers/ci@8bf61b26e9c3a98f69cb6ce2f88d24ff59b785c6 #v0.3.1900000417 uses: docker://ghcr.io/vehagn/homelab-devcontainer
with: with:
cacheFrom: ghcr.io/vehagn/homelab-devcontainer args: tofu -chdir=${{ env.TOFU_DIR }} fmt -recursive -diff -check
push: never
runCmd: tofu -chdir=${{ env.TOFU_DIR }} fmt -recursive -diff -check