@@ -2,20 +2,21 @@ on: push
22
33env :
44 IMAGE : ${{ secrets.DOCKER_HUB_USERNAME }}/sdr-scanner
5+ PLATFORMS : linux/arm64/v8,linux/amd64
6+ CACHE_FROM : type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/sdr-scanner:cache
7+ CACHE_TO : type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/sdr-scanner:cache,mode=max
58
69jobs :
710 main :
811 runs-on : ubuntu-latest
912 steps :
1013 - name : Checkout
11- uses : actions/checkout@v4
12- - name : Set up docker cache
13- uses : actions/cache@v3
14- with :
15- path : cache
16- key : docker
14+ uses : actions/checkout@v5
1715 - name : Set up QEMU
1816 uses : docker/setup-qemu-action@v3
17+ with :
18+ cache-image : false
19+ platforms : ${{ env.PLATFORMS }}
1920 - name : Set up Docker Buildx
2021 uses : docker/setup-buildx-action@v3
2122 - name : Login to Docker Hub
@@ -28,51 +29,51 @@ jobs:
2829 echo "constexpr auto GIT_COMMIT = \"${{ github.sha }}\";" > sources/version.h
2930 echo "constexpr auto GIT_TAG = \"${{ github.ref_name }}\";" >> sources/version.h
3031 - name : Build test
31- uses : docker/build-push-action@v5
32+ uses : docker/build-push-action@v6
3233 with :
3334 context : .
3435 load : true
3536 target : test
3637 tags : ${{ env.IMAGE }}:test
37- cache-from : type=local,src=cache
38- cache-to : type=local,dest=cache,mode=max
38+ cache-from : ${{ env.CACHE_FROM }}
39+ cache-to : ${{ env.CACHE_TO }}
3940 - name : Build app
40- uses : docker/build-push-action@v5
41+ uses : docker/build-push-action@v6
4142 with :
4243 build-args : |
4344 VERSION=${{ github.ref_name }}
4445 COMMIT=${{ github.sha }}
4546 context : .
46- cache-from : type=local,src=cache
47- cache-to : type=local,dest=cache,mode=max
47+ cache-from : ${{ env.CACHE_FROM }}
48+ cache-to : ${{ env.CACHE_TO }}
4849 - name : Run test
4950 run : |
5051 docker run --rm ${{ env.IMAGE }}:test
5152 - name : Push development version
5253 if : ${{ github.ref_type == 'branch' && contains(vars.CI_BRANCH, github.ref_name) }}
53- uses : docker/build-push-action@v5
54+ uses : docker/build-push-action@v6
5455 with :
5556 build-args : |
5657 VERSION=${{ github.ref_name }}
5758 COMMIT=${{ github.sha }}
5859 context : .
5960 push : true
60- platforms : linux/arm64/v8,linux/amd64
61+ platforms : ${{ env.PLATFORMS }}
6162 tags : ${{ env.IMAGE }}:${{ github.ref_name }}
62- cache-from : type=local,src=cache
63- cache-to : type=local,dest=cache,mode=max
63+ cache-from : ${{ env.CACHE_FROM }}
64+ cache-to : ${{ env.CACHE_TO }}
6465 - name : Push release version
6566 if : ${{ github.ref_type == 'tag' }}
66- uses : docker/build-push-action@v5
67+ uses : docker/build-push-action@v6
6768 with :
6869 build-args : |
6970 VERSION=${{ github.ref_name }}
7071 COMMIT=${{ github.sha }}
7172 context : .
7273 push : true
73- platforms : linux/arm64/v8,linux/amd64
74+ platforms : ${{ env.PLATFORMS }}
7475 tags : |
7576 ${{ env.IMAGE }}:latest
7677 ${{ env.IMAGE }}:${{ github.ref_name }}
77- cache-from : type=local,src=cache
78- cache-to : type=local,dest=cache,mode=max
78+ cache-from : ${{ env.CACHE_FROM }}
79+ cache-to : ${{ env.CACHE_TO }}
0 commit comments