From c27d612d7d83a09e3964ee10b88263b8fa7c4213 Mon Sep 17 00:00:00 2001 From: Martin McCaffery Date: Fri, 20 Feb 2026 09:59:10 +0100 Subject: [PATCH] Make build pipeline work for us --- .github/workflows/build-and-push.yml | 42 +++++++++++++++++----------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index cdb608d4..00e56aab 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -1,5 +1,17 @@ -name: "Build and push GARM images" +name: "Build and push GARM images to EDP" on: + workflow_dispatch: + inputs: + push_to_project: + description: "Project to build images for, defaults to DevFW-CICD" + required: false + type: string + default: "edp.buildth.ing/DevFW-CICD" + ref: + description: "Branch/tag to build" + required: false + type: string + default: "feat/forgejo" workflow_call: inputs: push_to_project: @@ -11,36 +23,32 @@ on: description: "Ref to build" required: false type: string - default: "main" + default: "feat/forgejo" permissions: contents: read jobs: images: - permissions: - packages: write + name: "Build GARM images" - runs-on: ubuntu-noble-garm + runs-on: ubuntu-latest steps: - name: "Checkout" - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: path: src/github.com/cloudbase/garm fetch-depth: 0 - - name: Set up Docker - uses: docker/setup-docker-action@v4 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + - name: Docker login + run: | + REGISTRY="${GITHUB_SERVER_URL#https://}" + echo "${{ secrets.PACKAGES_TOKEN }}" | docker login "$REGISTRY" -u "${{ github.repository_owner }}" --password-stdin + echo "DOCKER_REGISTRY=$REGISTRY" >> "$GITHUB_ENV" + echo "DOCKER_ORG=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV" - name: Build and push image env: @@ -50,6 +58,8 @@ jobs: run: | if [ "$GH_REF" == "main" ]; then IMAGE_TAG="nightly" + elif [ "$GH_REF" == "feat/forgejo" ]; then + IMAGE_TAG="forgejo" else IMAGE_TAG=$(git describe --tags --match='v[0-9]*' --always ${GH_REF}) fi