-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (54 loc) · 2.47 KB
/
Copy pathdevcontainer.yml
File metadata and controls
62 lines (54 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Dev container image (ghcr.io)
# Builds the FULL dev container (the CUDA 12.1 Dockerfile plus the devcontainer
# features in .devcontainer/devcontainer.json) with the Dev Containers CLI and
# pushes it to ghcr.io, so "Reopen in Container" pulls a ready-made image instead
# of building locally. Sibling of docker.yml (which publishes the plain runtime
# image); this one bakes the dev tooling on top. MANUAL only (workflow_dispatch):
# the CUDA-devel base + full deps is a large, slow build. Uses the built-in
# GITHUB_TOKEN. After the first push, set the package's visibility to Public in
# the repo's Packages settings so contributors can pull it without auth.
on:
workflow_dispatch:
inputs:
tag:
description: "Image tags to publish, comma-separated (e.g. 0.1.5,latest)"
default: "latest"
required: true
permissions:
contents: read
packages: write
jobs:
devcontainer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# The CUDA-devel image is large; reclaim runner disk before building.
- name: Free up disk space
run: |
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android /opt/hostedtoolcache/CodeQL
df -h
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# docker/docker-compose.yml references `.env` (gitignored, absent on a fresh
# checkout); seed it so the Dev Containers CLI can parse the compose file.
- name: Seed .env for compose parsing
run: cp -n .env.example .env || true
- name: Lowercase the image name
id: img
run: echo "name=ghcr.io/${GITHUB_REPOSITORY,,}-devcontainer" >> "$GITHUB_OUTPUT"
# Builds the devcontainer (Dockerfile + features) and pushes it. The image's
# devcontainer.metadata label lets clients skip re-applying features on open;
# postCreateCommand (setup.sh) still runs at open time by design.
- name: Build and push dev container
uses: devcontainers/ci@v0.3
with:
# Build from source. The interactive configuration pulls the existing
# prebuilt image and must not be used to publish its replacement.
configFile: .devcontainer/devcontainer.build.json
imageName: ${{ steps.img.outputs.name }}
imageTag: ${{ github.event.inputs.tag }}
cacheFrom: ${{ steps.img.outputs.name }}
push: always