Skip to content

Commit 6643b87

Browse files
committed
.github: Build devcontainer in CI
1 parent 077446c commit 6643b87

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"dockerfile": "Dockerfile",
55
"options": [
66
"--platform=linux/amd64"
7+
],
8+
"cacheFrom": [
9+
"type=gha,scope=devcontainer"
710
]
811
},
912
"features": {
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: build devcontainer
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
tags:
7+
type: string
8+
required: true
9+
description: 'The tags to publish the image with'
10+
skip:
11+
type: boolean
12+
required: false
13+
default: false
14+
description: 'Skip the build and publish'
15+
16+
jobs:
17+
build-and-publish-devcontainer:
18+
runs-on: ubuntu-24.04
19+
permissions:
20+
contents: read
21+
packages: write
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v3
27+
- name: Login to the registry
28+
uses: docker/login-action@v3
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.repository_owner }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
- name: Build dev container
34+
# NOTE: We only skip this and not the full Job
35+
# otherwise step that "need" it will not be started
36+
if: ${{ ! inputs.skip }}
37+
uses: docker/build-push-action@v6
38+
with:
39+
context: .devcontainer/
40+
push: true
41+
tags: ghcr.io/${{ github.repository }}/devcontainer:${{ inputs.tags }}
42+
cache-from: type=gha,scope=devcontainer
43+
cache-to: type=gha,mode=max,scope=devcontainer

0 commit comments

Comments
 (0)