1
0
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:
Nicolas Duchon
2022-01-14 14:29:03 +01:00
parent 2daa09ff21
commit 0ff39b804c

View File

@ -28,6 +28,9 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Retrieve version
run: echo "GIT_DESCRIBE=$(git describe --tags)" >> $GITHUB_ENV
- name: Get Docker tags for Debian based image - name: Get Docker tags for Debian based image
id: docker_meta_debian id: docker_meta_debian
@ -40,6 +43,8 @@ jobs:
type=semver,pattern={{version}} type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }} 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 - name: Set up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v1
@ -53,9 +58,6 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Retrieve version
run: echo "GIT_DESCRIBE=$(git describe --tags)" >> $GITHUB_ENV
- name: Build and push the Debian based image - name: Build and push the Debian based image
id: docker_build_debian id: docker_build_debian
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
@ -79,6 +81,9 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Retrieve version
run: echo "GIT_DESCRIBE=$(git describe --tags)" >> $GITHUB_ENV
- name: Get Docker tags for Alpine based image - name: Get Docker tags for Alpine based image
id: docker_meta_alpine id: docker_meta_alpine
@ -91,6 +96,8 @@ jobs:
type=semver,suffix=-alpine,pattern={{version}} type=semver,suffix=-alpine,pattern={{version}}
type=semver,suffix=-alpine,pattern={{major}}.{{minor}} type=semver,suffix=-alpine,pattern={{major}}.{{minor}}
type=raw,value=alpine,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }} type=raw,value=alpine,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
labels: |
org.opencontainers.image.version=${{ env.GIT_DESCRIBE }}
flavor: latest=false flavor: latest=false
- name: Set up QEMU - name: Set up QEMU
@ -105,9 +112,6 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Retrieve version
run: echo "GIT_DESCRIBE=$(git describe --tags)" >> $GITHUB_ENV
- name: Build and push the Alpine based image - name: Build and push the Alpine based image
id: docker_build_alpine id: docker_build_alpine
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2