Skip to content

Commit 63176c2

Browse files
committed
ci: rename build / publish workflow
+ enable gha caching on docker/build-push-action
1 parent af2d179 commit 63176c2

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/dockerhub.yml renamed to .github/workflows/build-publish.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: DockerHub
1+
name: Build and publish Docker image
22

33
on:
44
workflow_dispatch:
@@ -13,13 +13,14 @@ on:
1313
- "v*.*.*"
1414
paths:
1515
- ".dockerignore"
16-
- ".github/workflows/dockerhub.yml"
16+
- ".github/workflows/build-publish.yml"
1717
- "app/*"
1818
- "Dockerfile"
1919
- "install_acme.sh"
2020

2121
jobs:
2222
multiarch-build:
23+
name: Build and publish Docker image
2324
runs-on: ubuntu-latest
2425
steps:
2526
- name: Checkout
@@ -28,7 +29,8 @@ jobs:
2829
fetch-depth: 0
2930

3031
- name: Retrieve version
31-
run: echo "GIT_DESCRIBE=$(git describe --tags)" >> $GITHUB_ENV
32+
id: acme-companion_version
33+
run: echo "VERSION=$(git describe --tags)" >> "$GITHUB_OUTPUT"
3234

3335
- name: Get Docker tags
3436
id: docker_meta
@@ -44,7 +46,7 @@ jobs:
4446
type=raw,value=latest,enable={{is_default_branch}}
4547
labels: |
4648
org.opencontainers.image.authors=Nicolas Duchon <nicolas.duchon@gmail.com> (@buchdag), Yves Blusseau
47-
org.opencontainers.image.version=${{ env.GIT_DESCRIBE }}
49+
org.opencontainers.image.version=${{ steps.acme-companion_version.outputs.VERSION }}
4850
4951
- name: Set up QEMU
5052
uses: docker/setup-qemu-action@v2
@@ -70,11 +72,13 @@ jobs:
7072
uses: docker/build-push-action@v4
7173
with:
7274
context: .
73-
build-args: GIT_DESCRIBE=${{ env.GIT_DESCRIBE }}
75+
build-args: GIT_DESCRIBE=${{ steps.acme-companion_version.outputs.VERSION }}
7476
platforms: linux/amd64,linux/arm64,linux/arm/v7
7577
push: true
7678
tags: ${{ steps.docker_meta.outputs.tags }}
7779
labels: ${{ steps.docker_meta.outputs.labels }}
80+
cache-from: type=gha
81+
cache-to: type=gha,mode=max
7882

7983
- name: Image digest
8084
run: echo ${{ steps.docker_build.outputs.digest }}

0 commit comments

Comments
 (0)