@@ -10,54 +10,40 @@ jobs:
10
10
steps :
11
11
12
12
- name : Checkout
13
- uses : actions/checkout@v2
13
+ uses : actions/checkout@v3
14
14
15
15
- name : Set up QEMU
16
- uses : docker/setup-qemu-action@v1
16
+ uses : docker/setup-qemu-action@v2
17
17
18
18
# We use buildx instead of regular build so we can take advantage of Docker layer cache via GithubActions' cache
19
19
- name : Set up Docker Buildx
20
20
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
31
22
32
23
- name : Docker Login to GitHub Container Registry
33
- uses : docker/login-action@v1
24
+ uses : docker/login-action@v2
34
25
with :
35
26
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.
43
29
44
30
- name : Build and push
45
31
id : docker_build
46
- uses : docker/build-push-action@v2
32
+ uses : docker/build-push-action@v3
47
33
with :
48
34
context : .
49
35
file : ./Dockerfile
50
36
platforms : linux/amd64,linux/arm64
37
+ pull : true
51
38
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
53
40
labels : |
54
41
org.opencontainers.image.title=${{ github.event.repository.name }}
55
42
org.opencontainers.image.description=${{ github.event.repository.description }}
56
43
org.opencontainers.image.url=${{ github.event.repository.html_url }}
57
44
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
58
- org.opencontainers.image.created=${{ steps.prep.outputs.created }}
59
45
org.opencontainers.image.revision=${{ github.sha }}
60
46
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
63
49
0 commit comments