Skip to content

Commit 8409484

Browse files
committed
update GHA workflow
1 parent a0a8682 commit 8409484

File tree

1 file changed

+9
-23
lines changed

1 file changed

+9
-23
lines changed

.github/workflows/master-latest.yml

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,22 @@ 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
@@ -48,16 +34,16 @@ jobs:
4834
context: .
4935
file: ./Dockerfile
5036
platforms: linux/amd64,linux/arm64
37+
pull: true
5138
push: true
5239
tags: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest,ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}
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

Comments
 (0)