-
Notifications
You must be signed in to change notification settings - Fork 2
173 lines (166 loc) · 6.19 KB
/
docker-full-current.yml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
---
name: Slackware -current Full Docker Image
on:
workflow_dispatch:
push:
branches:
- master
paths:
- full/current/**/*
- scripts/install_all.sh
concurrency:
group: docker-full-current-${{ github.head_ref || github.ref_name }}
cancel-in-progress: false
env:
REGISTRY_IMAGE: aclemons/slackware
# renovate: datasource=docker depName=nginx versioning=docker
NGINX_IMAGE_VERSION: 1.27.1@sha256:1540e37eebb9abc5afa4256de1bade6542d50bf69b61b1dd855cb7804aaaf444
jobs:
build-current:
runs-on: ubuntu-24.04
permissions:
packages: write
strategy:
fail-fast: false
matrix:
platform:
- linux/386
- linux/amd64
- linux/arm64/v8
steps:
- name: Maximise disc space
run: |
df -h
printf '\n'
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
printf '\n'
df -h
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
show-progress: false
- name: Set artifact name
run: |
if [ "${{ matrix.platform }}" = "linux/386" ] ; then
printf 'ARTIFACT_NAME=digests-386\n' >> "$GITHUB_ENV"
elif [ "${{ matrix.platform }}" = "linux/amd64" ] ; then
printf 'ARTIFACT_NAME=digests-amd64\n' >> "$GITHUB_ENV"
elif [ "${{ matrix.platform }}" = "linux/arm64/v8" ] ; then
printf 'ARTIFACT_NAME=digests-arm64\n' >> "$GITHUB_ENV"
else
echo "Unhandled platform ${{ matrix.platform }}"
exit 1
fi
- name: Docker meta
id: meta
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1
with:
images: ${{ env.REGISTRY_IMAGE }}
tags: |
type=raw,value=current-full
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
with:
driver-opts: |
network=host
- name: Sync mirror
run: |
docker run -d --rm -v "$(pwd)/local_mirrors:/usr/share/nginx/html:ro" -p 3000:80 --name mirror nginx:${{ env.NGINX_IMAGE_VERSION }}
dir=""
if [ "${{ matrix.platform }}" = "linux/386" ] ; then
dir="slackware-current"
elif [ "${{ matrix.platform }}" = "linux/amd64" ] ; then
dir="slackware64-current"
elif [ "${{ matrix.platform }}" = "linux/arm64/v8" ] ; then
dir="slackwareaarch64-current"
else
echo "Unhandled platform ${{ matrix.platform }}"
exit 1
fi
# check that the mirror is working
./scripts/sync_local_mirror.sh "$dir"
curl -s -f "http://localhost:3000/$dir/ChangeLog.txt" -o /dev/null
curl --head "http://localhost:3000/$dir/ChangeLog.txt"
- name: Login to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Login to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push by digest
id: build
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0
with:
file: full/current/Dockerfile
context: .
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
network: host
build-args: |
mirror_base=http://localhost:3000
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: ${{ env.ARTIFACT_NAME }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
merge-current:
runs-on: ubuntu-24.04
permissions:
packages: write
needs:
- build-current
steps:
- name: Download digests
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
pattern: digests-*
path: /tmp/digests
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
- name: Docker meta
id: meta
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1
with:
images: ${{ env.REGISTRY_IMAGE }}
tags: |
type=raw,value=current-full
- name: Login to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Login to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
# shellcheck disable=SC2046
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}