@@ -3,18 +3,16 @@ name: Build the Python3 container
33
44on :
55 push :
6- branches :
7- - main
86 paths :
9- - python3/**
7+ - " python3/**"
8+ - " .github/workflows/build-python3.yaml"
109 schedule :
1110 - cron : ' 0 7 * * *'
1211 workflow_dispatch :
1312
14-
1513jobs :
1614 build-push-apache2 :
17- runs-on : ubuntu-latest
15+ runs-on : " ubuntu-22.04 "
1816 permissions :
1917 packages : write
2018 steps :
@@ -23,18 +21,14 @@ jobs:
2321
2422 - name : Set up QEMU
2523 uses : docker/setup-qemu-action@v3
24+ with :
25+ platforms : " linux/amd64,linux/arm64"
26+ # The latest version will lead to segmentation fault.
27+ image : " tonistiigi/binfmt:qemu-v7.0.0-28"
2628
2729 - name : Set up Docker Buildx
2830 uses : docker/setup-buildx-action@v3
2931
30- - name : Cache Docker layers
31- uses : actions/cache@v4
32- with :
33- path : /tmp/.buildx-cache
34- key : ${{ runner.os }}-buildx-${{ github.sha }}
35- restore-keys : |
36- ${{ runner.os }}-buildx-
37-
3832 - name : Login to GitHub Container Registry
3933 uses : docker/login-action@v3
4034 with :
@@ -46,18 +40,11 @@ jobs:
4640 uses : docker/build-push-action@v6
4741 with :
4842 context : ./apache2
49- platforms : linux/amd64,linux/arm64
50- push : true
43+ platforms : " linux/amd64,linux/arm64"
44+ # only push the latest tag on the main branch
45+ push : " ${{ github.ref == 'refs/heads/main' }}"
5146 tags : |
5247 ghcr.io/openconext/openconext-basecontainers/python3:latest
5348 ghcr.io/openconext/openconext-basecontainers/python3:${{ github.sha }}
54- cache-from : type=local,src=/tmp/.buildx-cache
55- cache-to : type=local,dest=/tmp/.buildx-cache-new,mode=max
56-
57- - # Temp fix
58- # https://github.com/docker/build-push-action/issues/252
59- # https://github.com/moby/buildkit/issues/1896
60- name : Move cache
61- run : |
62- rm -rf /tmp/.buildx-cache
63- mv /tmp/.buildx-cache-new /tmp/.buildx-cache
49+ cache-from : type=gha
50+ cache-to : type=gha
0 commit comments