|
@@ -12,12 +12,28 @@ jobs:
|
|
|
runs-on: ubuntu-22.04
|
|
|
permissions: {packages: write}
|
|
|
steps:
|
|
|
+ - id: meta
|
|
|
+ # > "automatic" tag management and OCI Image Format Spec… for labels
|
|
|
+ # https://web.archive.org/web/20250103123053/https://docs.docker.com/build/ci/github-actions/manage-tags-labels/
|
|
|
+ uses: docker/metadata-action@v5
|
|
|
+ with:
|
|
|
+ images: ghcr.io/${{ github.actor }}/systemctl-mqtt
|
|
|
+ # https://web.archive.org/web/20250103130404/https://github.com/docker/metadata-action?tab=readme-ov-file#tags-input
|
|
|
+ tags: |
|
|
|
+ type=semver,pattern={{version}}
|
|
|
+ type=ref,event=branch
|
|
|
+ type=ref,event=pr
|
|
|
+ type=sha,format=long
|
|
|
+ type=raw,value=latest,enable=false
|
|
|
- uses: docker/setup-qemu-action@v3.2.0
|
|
|
- uses: docker/login-action@v3
|
|
|
with:
|
|
|
registry: ghcr.io
|
|
|
username: ${{ github.actor }}
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
+ # > setup-buildx action … is not required but recommended using it to be
|
|
|
+ # > able to build multi-platform images, export cache, etc.
|
|
|
+ # https://web.archive.org/web/20250103122420/https://github.com/marketplace/actions/build-and-push-docker-images
|
|
|
- uses: docker/setup-buildx-action@v3.8.0
|
|
|
# > By default, this action uses the Git context so you don't need to use
|
|
|
# > the actions/checkout action to checkout the repository because this
|
|
@@ -37,5 +53,5 @@ jobs:
|
|
|
linux/arm/v7
|
|
|
linux/arm64
|
|
|
push: true
|
|
|
- tags: |
|
|
|
- ghcr.io/${{ github.actor }}/systemctl-mqtt:${{ github.sha }}-attempt${{ github.run_attempt }}
|
|
|
+ tags: ${{ steps.meta.outputs.tags }}
|
|
|
+ labels: ${{ steps.meta.outputs.labels }}
|