-
-
Notifications
You must be signed in to change notification settings - Fork 111
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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: uv cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
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@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
with:
platforms: linux/${{ inputs.architecture }}
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@3cb05d89e1f492524af3d41a1c98c83bc3025124 # v3.1.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- 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@5b81f4d29dc8397a7d341dba3aeecc7ec54d6361 # v3.3.0
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@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: Docker cache ${{ inputs.architecture }}
path: /tmp/.buildx-cache/linux/${{ inputs.architecture }}
retention-days: 1
permissions:
contents: read