From 8a34b35de83f8ad8b51325c6152a2aeee83b12c5 Mon Sep 17 00:00:00 2001 From: Alex Povel Date: Sun, 4 Sep 2022 14:35:52 +0200 Subject: [PATCH] feat(build): Enable Docker image versioning Currently, we're building on release aka tags only anyway, so release three (plus `latest`) corresponding tags, to point to major/minor/patch. Closes #23 --- .github/workflows/publish.yml | 4 ++++ self-hosting/docker-compose.yml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index faf4497..88e56a6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -155,6 +155,10 @@ jobs: uses: docker/metadata-action@v4 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }} - name: Build and push Docker image uses: docker/build-push-action@v3 diff --git a/self-hosting/docker-compose.yml b/self-hosting/docker-compose.yml index 5a97771..414a750 100644 --- a/self-hosting/docker-compose.yml +++ b/self-hosting/docker-compose.yml @@ -15,7 +15,7 @@ services: - 443:443 restart: unless-stopped ancv: - image: ghcr.io/alexpovel/ancv:main + image: ghcr.io/alexpovel/ancv:1 volumes: - ./resume.json:/resume.json:ro ports: