mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-07-01 14:25:46 +00:00
ci: use git describe for OCI image version label
This commit is contained in:
16
.github/workflows/dockerhub.yml
vendored
16
.github/workflows/dockerhub.yml
vendored
@ -29,6 +29,9 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Retrieve version
|
||||
run: echo "GIT_DESCRIBE=$(git describe --tags)" >> $GITHUB_ENV
|
||||
|
||||
- name: Get Docker tags for Debian based image
|
||||
id: docker_meta_debian
|
||||
uses: docker/metadata-action@v3
|
||||
@ -40,6 +43,8 @@ jobs:
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
|
||||
labels: |
|
||||
org.opencontainers.image.version=${{ env.GIT_DESCRIBE }}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
@ -53,9 +58,6 @@ jobs:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Retrieve version
|
||||
run: echo "GIT_DESCRIBE=$(git describe --tags)" >> $GITHUB_ENV
|
||||
|
||||
- name: Build and push the Debian based image
|
||||
id: docker_build_debian
|
||||
uses: docker/build-push-action@v2
|
||||
@ -80,6 +82,9 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Retrieve version
|
||||
run: echo "GIT_DESCRIBE=$(git describe --tags)" >> $GITHUB_ENV
|
||||
|
||||
- name: Get Docker tags for Alpine based image
|
||||
id: docker_meta_alpine
|
||||
uses: docker/metadata-action@v3
|
||||
@ -91,6 +96,8 @@ jobs:
|
||||
type=semver,suffix=-alpine,pattern={{version}}
|
||||
type=semver,suffix=-alpine,pattern={{major}}.{{minor}}
|
||||
type=raw,value=alpine,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
|
||||
labels: |
|
||||
org.opencontainers.image.version=${{ env.GIT_DESCRIBE }}
|
||||
flavor: latest=false
|
||||
|
||||
- name: Set up QEMU
|
||||
@ -105,9 +112,6 @@ jobs:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Retrieve version
|
||||
run: echo "GIT_DESCRIBE=$(git describe --tags)" >> $GITHUB_ENV
|
||||
|
||||
- name: Build and push the Alpine based image
|
||||
id: docker_build_alpine
|
||||
uses: docker/build-push-action@v2
|
||||
|
Reference in New Issue
Block a user