mirror of
https://github.com/outbackdingo/homelab-v.git
synced 2026-08-25 14:53:19 +00:00
feat(devcontainer): build a Devcontainer with useful tools for this project
Also use said devcontainer i GitHub workflows to validate config. * feat(devcontainer): build devcontainer Signed-off-by: Vegard Hagen <[email protected]> * feat(ci): validate tofu files on push Signed-off-by: Vegard Hagen <[email protected]> * feat(devcontainer): simplify devcontainer Signed-off-by: Vegard Hagen <[email protected]> * fix(devcontainer): don't cache package index This will reduce the final image size. Signed-off-by: Vegard Hagen <[email protected]> * feat(devcontainer): switch to ubuntu and use devcontainer features as much as possible Signed-off-by: Vegard Hagen <[email protected]> --------- Signed-off-by: Vegard Hagen <[email protected]>
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
name: Build devcontainer
|
||||
|
||||
on:
|
||||
workflow_dispatch: { }
|
||||
push:
|
||||
branches: [ main ]
|
||||
paths: [ ".devcontainer/**" ]
|
||||
schedule:
|
||||
- cron: "4 20 28 * *"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build devcontainer
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
|
||||
|
||||
- name: Set up QEMU for multi-architecture builds
|
||||
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 #v3.6.0
|
||||
|
||||
- name: Setup Docker buildx for multi-architecture builds
|
||||
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 #v3.11.1
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 #v3.4.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Pre-build dev container image
|
||||
uses: devcontainers/ci@8bf61b26e9c3a98f69cb6ce2f88d24ff59b785c6 #v0.3.1900000417
|
||||
with:
|
||||
platform: linux/amd64,linux/arm64
|
||||
imageName: ghcr.io/vehagn/homelab-devcontainer
|
||||
cacheFrom: ghcr.io/vehagn/homelab-devcontainer
|
||||
push: always
|
||||
Reference in New Issue
Block a user