simplify workflows

This commit is contained in:
Lionel ORRY 2025-07-30 14:35:01 +02:00
parent eb07ed3774
commit 158b35db06
3 changed files with 11 additions and 19 deletions

View file

@ -42,22 +42,16 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
- name: Build and push image
env:
REGISTRY_INPUT: ${{ inputs.push_to_project }}
IMAGE_REGISTRY: ${{ inputs.push_to_project }}
GH_REF: ${{ inputs.ref }}
working-directory: src/github.com/cloudbase/garm
run: |
if [ "$GH_REF" == "main" ]; then
VERSION="nightly"
IMAGE_TAG="nightly"
else
VERSION=$(git describe --tags --match='v[0-9]*' --always)
fi
if [ "$GH_REF" == "release/v0.1" ]; then
VERSION="v0.1"
fi
if [ "$GH_REF" == "release/v0.2" ]; then
VERSION="v0.2"
IMAGE_TAG=$(git describe --tags --match='v[0-9]*' --always)
fi
docker buildx build \
--provenance=false \
@ -66,5 +60,5 @@ jobs:
--label "org.opencontainers.image.description=GARM ${GH_REF}" \
--label "org.opencontainers.image.licenses=Apache 2.0" \
--build-arg="GARM_REF=${GH_REF}" \
-t ${REGISTRY_INPUT}/garm:"${VERSION}" \
-t ${IMAGE_REGISTRY}/garm:"${IMAGE_TAG}" \
--push .

View file

@ -6,8 +6,5 @@ on:
jobs:
call-build-and-push:
uses: ./.github/workflows/build-and-push.yml
strategy:
matrix:
ref: ["main", "release/v0.1", "release/v0.2"]
with:
ref: ${{ matrix.ref }}
ref: "main"