@@ -10,54 +10,40 @@ jobs:
1010 steps :
1111
1212 - name : Checkout
13- uses : actions/checkout@v2
13+ uses : actions/checkout@v3
1414
1515 - name : Set up QEMU
16- uses : docker/setup-qemu-action@v1
16+ uses : docker/setup-qemu-action@v2
1717
1818 # We use buildx instead of regular build so we can take advantage of Docker layer cache via GithubActions' cache
1919 - name : Set up Docker Buildx
2020 id : buildx
21- uses : docker/setup-buildx-action@v1
22-
23- # Setup the Github Actions cache.
24- - name : Cache Docker layers
25- uses : actions/cache@v2
26- with :
27- path : /tmp/.buildx-cache
28- key : ${{ runner.os }}-buildxarch-${{ github.sha }}
29- restore-keys : |
30- ${{ runner.os }}-buildxarch-
21+ uses : docker/setup-buildx-action@v2
3122
3223 - name : Docker Login to GitHub Container Registry
33- uses : docker/login-action@v1
24+ uses : docker/login-action@v2
3425 with :
3526 registry : ghcr.io
36- username : ${{ github.repository_owner }} # github username or org
37- password : ${{ secrets.GITHUB_TOKEN }} # github actions builtin token. repo has to have pkg access.
38-
39- - name : Prepare
40- id : prep
41- run : |
42- echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
27+ username : ${{ github.repository_owner }} # GitHub username or org
28+ password : ${{ secrets.GITHUB_TOKEN }} # GitHub actions builtin token. repo has to have pkg access.
4329
4430 - name : Build and push
4531 id : docker_build
46- uses : docker/build-push-action@v2
32+ uses : docker/build-push-action@v3
4733 with :
4834 context : .
4935 file : ./Dockerfile
5036 platforms : linux/amd64,linux/arm64
37+ pull : true
5138 push : true
52- tags : ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest,ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}
39+ tags : ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest
5340 labels : |
5441 org.opencontainers.image.title=${{ github.event.repository.name }}
5542 org.opencontainers.image.description=${{ github.event.repository.description }}
5643 org.opencontainers.image.url=${{ github.event.repository.html_url }}
5744 org.opencontainers.image.source=${{ github.event.repository.clone_url }}
58- org.opencontainers.image.created=${{ steps.prep.outputs.created }}
5945 org.opencontainers.image.revision=${{ github.sha }}
6046 org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }}
61- cache-from : type=local,src=/tmp/.buildx-cache/release
62- cache-to : type=local ,mode=max,dest=/tmp/.buildx-cache/release
47+ cache-from : type=gha # all-automatic GitHub Actions caching
48+ cache-to : type=gha ,mode=max
6349
0 commit comments