-
-
Notifications
You must be signed in to change notification settings - Fork 113
69 lines (67 loc) · 2.41 KB
/
container-build.yml
File metadata and controls
69 lines (67 loc) · 2.41 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
68
69
name: Docker container build
on:
workflow_call:
inputs:
variant:
required: true
type: string
architecture:
required: true
type: string
weblate_sha:
required: false
type: string
weblate_date:
required: false
type: string
jobs:
container-build:
runs-on: ${{ inputs.architecture == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
name: Build, ${{ inputs.variant }}, ${{ inputs.architecture }}
env:
MATRIX_ARCHITECTURE: linux/${{ inputs.architecture }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: uv cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
id: cache
with:
path: uv-cache
key: uv-cache-${{ hashFiles('Dockerfile') }}-${{ inputs.architecture }}
- name: Set up QEMU
if: inputs.architecture != 'amd64' && inputs.architecture != 'arm64'
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
with:
platforms: linux/${{ inputs.architecture }}
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@04d248b84655b509d8c44dc1d6f990c879747487 # v4.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Adjust bleeding edge image
if: inputs.variant == 'bleeding'
run: .github/bin/bleeding "$WEBLATE_SHA" "$WEBLATE_DATE"
env:
WEBLATE_SHA: ${{ inputs.weblate_sha }}
WEBLATE_DATE: ${{ inputs.weblate_date }}
- name: Configure Docker build
run: .github/bin/get-buildx-args
- name: inject cache into docker
uses: reproducible-containers/buildkit-cache-dance@1b8ab18fbda5ad3646e3fcc9ed9dd41ce2f297b4 # v3.3.2
with:
cache-map: |
{
"uv-cache": "/.uv-cache"
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
- run: mkdir -p "/tmp/.buildx-cache/$MATRIX_ARCHITECTURE"
- name: Build the Docker image
run: .github/bin/docker-build
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Docker cache ${{ inputs.architecture }}
path: /tmp/.buildx-cache/linux/${{ inputs.architecture }}
retention-days: 1
permissions:
contents: read