forked from LinuxCNC/linuxcnc
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (62 loc) · 1.93 KB
/
Copy pathdocker.yml
File metadata and controls
67 lines (62 loc) · 1.93 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
63
64
65
66
67
# vim: sw=2
name: Build Docker
on:
workflow_dispatch:
schedule:
- cron: "18 0 * * 1"
permissions:
contents: read # to fetch code (actions/checkout)
packages: write # to create docker images
jobs:
build-docker:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner: ["ubuntu-24.04", "ubuntu-24.04-arm"]
debian_version: ["bookworm", "trixie", "sid"]
include:
- runner_arch: amd64
runner: ubuntu-24.04
- runner_arch: arm64
runner: ubuntu-24.04-arm
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo Number of CPUs: $(nproc)
echo "$GITHUB_CONTEXT"
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: false
fetch-depth: 1
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v4
- name: Log in to the Container registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v7
with:
context: .
file: .github/docker/Dockerfile
build-args: |
BASE_IMAGE=debian:${{ matrix.debian_version }}
push: true
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=LinuxCNC build image
tags: ghcr.io/${{ github.repository_owner }}/linuxcnc/build-container:${{ matrix.debian_version }}-${{ matrix.runner_arch }}-latest
#Fails due to unknown reason
# cleanup-docker:
# runs-on: ubuntu-24.04
# steps:
# - name: Cleanup untagged images
# uses: actions/delete-package-versions@v5
# with:
# package-name: 'build-container'
# package-type: 'container'
# min-versions-to-keep: 10
# delete-only-untagged-versions: 'true'