11name : Build Docker container on push
22
33on :
4- push :
5- branches :
6- - " *"
4+ push :
5+ branches :
6+ - " *"
77
88jobs :
99 build :
1010 name : Build image
11- runs-on : ubuntu-20.04
11+ runs-on : ubuntu-24.04
12+
13+ permissions :
14+ contents : read
15+ packages : write
16+ id-token : write
1217
1318 steps :
1419 - name : Checkout project
15- uses : actions/checkout@v3
20+ uses : actions/checkout@v4
1621
1722 - name : Set env variables
1823 run : |
@@ -21,23 +26,25 @@ jobs:
2126 echo "IMAGE_NAME=${REPO_OWNER,,}/${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
2227
2328 - name : Login to GitHub Container Registry
24- uses : docker/login-action@v1
29+ uses : docker/login-action@v3
2530 with :
2631 registry : ghcr.io
2732 username : ${{ github.repository_owner }}
2833 password : ${{ secrets.GITHUB_TOKEN }}
2934
3035 - name : Set up QEMU
31- uses : docker/setup-qemu-action@v2
36+ uses : docker/setup-qemu-action@v3
3237 id : qemu
3338
3439 - name : Setup Docker buildx action
35- uses : docker/setup-buildx-action@v2
40+ uses : docker/setup-buildx-action@v3
3641 id : buildx
3742
3843 - name : Run Docker buildx
3944 run : |
40- docker buildx build \
41- --platform linux/amd64,linux/arm64 \
42- --tag ghcr.io/$IMAGE_NAME:$BRANCH \
43- --output "type=registry" ./
45+ docker buildx build \
46+ --platform linux/amd64,linux/arm64 \
47+ --tag ghcr.io/$IMAGE_NAME:$BRANCH \
48+ --cache-from type=gha \
49+ --cache-to type=gha,mode=max \
50+ --output "type=registry" ./
0 commit comments