Skip to content

Commit

Permalink
refactor: versioning strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
bathienle committed Jan 23, 2024
1 parent 33813b9 commit e1d319a
Showing 1 changed file with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
tags:
- "*.*.*"

env:
IMAGE_VERSION: ${{ vars.NGINX_VERSION }}-${{ github.ref_name }}

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -16,6 +13,24 @@ jobs:
- name: Set up the repository
uses: actions/checkout@v3

- name: Release check
id: release
run: |
if [[ ${{ github.ref_name }} =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]]; then
echo "release=true" >> $GITHUB_OUTPUT
else
echo "release=false" >> $GITHUB_OUTPUT
fi
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: cytomineuliege/core
tags: |
type=raw,value=latest,enable=${{ steps.release.outputs.release }}
type=semver,pattern={{raw}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

Expand All @@ -31,11 +46,12 @@ jobs:
build-args: |
ENTRYPOINT_SCRIPTS_VERSION=${{ vars.ENTRYPOINT_SCRIPTS_VERSION }}
IMAGE_REVISION=${{ github.sha }}
IMAGE_VERSION=${{ env.IMAGE_VERSION }}
IMAGE_VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
NGINX_VERSION=${{ vars.NGINX_VERSION }}
UPLOAD_MODULE_COMMIT=${{ vars.UPLOAD_MODULE_COMMIT }}
UPLOAD_MODULE_REPO=${{ vars.UPLOAD_MODULE_REPO }}
context: .
file: ./Dockerfile
labels: ${{ steps.meta.outputs.labels }}
push: true
tags: cytomineuliege/nginx:${{ env.IMAGE_VERSION }}
tags: ${{ steps.meta.outputs.tags }}

0 comments on commit e1d319a

Please sign in to comment.