.github/workflows/buildx.yml: check for latest tag

This commit is contained in:
Christopher SHEN 2023-07-19 23:36:05 +08:00
parent 784a57aaab
commit da229acfb8
No known key found for this signature in database
GPG Key ID: AB91337A579ACE9B

View File

@ -11,6 +11,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
@ -26,6 +28,13 @@ jobs:
echo "GITLAB_DIR=omnibus-gitlab" >> $GITHUB_ENV
echo "DOCKER_DIR=omnibus-gitlab/docker" >> $GITHUB_ENV
echo "GITLAB_REF_TAG=$(echo ${{ github.ref_name }} | sed 's/\-/\+/')" >> $GITHUB_ENV
DOCKER_NAMESPACE=yrzr/gitlab-ce-arm64v8
LATEST=$(git tag | sort -rV | head -n 1)
if [ "${LATEST}" == "${{ github.ref_name }}" ]; then
echo "DOCKER_IMAGE_TAGS=${DOCKER_NAMESPACE}:$THIS_TAG,${DOCKER_NAMESPACE}:latest">> $GITHUB_ENV
else
echo "DOCKER_IMAGE_TAGS=${DOCKER_NAMESPACE}:$THIS_TAG">> $GITHUB_ENV
fi
- name: Check out https://github.com/gitlabhq/omnibus-gitlab.git
uses: actions/checkout@v3
with:
@ -47,4 +56,4 @@ jobs:
context: ${{ env.DOCKER_DIR }}
platforms: linux/arm64
push: true
tags: yrzr/gitlab-ce-arm64v8:${{ github.ref_name }}
tags: ${{ env.DOCKER_IMAGE_TAGS }}