Release major.minor container versions

This commit is contained in:
Andrew Dryga
2023-11-07 18:09:31 -06:00
parent c4a3c2a630
commit aa14be0280
2 changed files with 23 additions and 6 deletions

View File

@@ -208,8 +208,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images:
${{ steps.login.outputs.registry }}/firezone/${{
matrix.name.artifact }}
${{ steps.login.outputs.registry }}/firezone/${{matrix.name.artifact }}
tags: |
type=raw,value=${{ github.sha }}
type=raw,value=${{ env.VERSION }}
@@ -230,8 +229,7 @@ jobs:
type=registry,ref=${{ steps.login.outputs.registry }}/cache/${{ matrix.name.artifact }}:main,mode=max
target: release
outputs:
type=image,name=${{ steps.login.outputs.registry }}/firezone/${{
matrix.name.artifact}},push-by-digest=true,name-canonical=true,push=true
type=image,name=${{ steps.login.outputs.registry }}/firezone/${{matrix.name.artifact}},push-by-digest=true,name-canonical=true,push=true
- name: Export digest
run: |
mkdir -p /tmp/digests/${{ matrix.name.artifact }}
@@ -270,16 +268,25 @@ jobs:
path: /tmp/digests
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Version Tags
run: |
set -xe
MAJOR_VERSION="${VERSION%%.*}"
MAJOR_MINOR_VERSION="${VERSION%.*}"
echo "MAJOR_VERSION=${MAJOR_VERSION}" >> $GITHUB_ENV
echo "MAJOR_MINOR_VERSION=${MAJOR_MINOR_VERSION}" >> $GITHUB_ENV
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images:
${{ steps.login.outputs.registry }}/firezone/${{ matrix.image_name
}}
${{ steps.login.outputs.registry }}/firezone/${{ matrix.image_name }}
tags: |
type=raw,value=${{ github.sha }}
type=raw,value=${{ env.VERSION }}
type=raw,value=${{ env.MAJOR_VERSION }}
type=raw,value=${{ env.MAJOR_MINOR_VERSION }}
- name: Create manifest list and push
working-directory: /tmp/digests/${{ matrix.image_name }}
run: |

View File

@@ -95,6 +95,14 @@ jobs:
id: login
with:
project: firezone-staging
- name: Build Version Tags
run: |
set -xe
MAJOR_VERSION="${VERSION%%.*}"
MAJOR_MINOR_VERSION="${VERSION%.*}"
echo "MAJOR_VERSION=${MAJOR_VERSION}" >> $GITHUB_ENV
echo "MAJOR_MINOR_VERSION=${MAJOR_MINOR_VERSION}" >> $GITHUB_ENV
- name: Build Docker images
uses: docker/build-push-action@v5
with:
@@ -112,6 +120,8 @@ jobs:
push: true
target: ${{ matrix.target }}
tags: |
${{ steps.login.outputs.registry }}/firezone/${{ matrix.image_name }}:${{ env.MAJOR_VERSION }}
${{ steps.login.outputs.registry }}/firezone/${{ matrix.image_name }}:${{ env.MAJOR_MINOR_VERSION }}
${{ steps.login.outputs.registry }}/firezone/${{ matrix.image_name }}:${{ env.VERSION }}-${{ github.sha }}
${{ steps.login.outputs.registry }}/firezone/${{ matrix.image_name }}:${{ env.BRANCH_TAG }}
${{ steps.login.outputs.registry }}/firezone/${{ matrix.image_name }}:${{ github.sha }}