From ed6b95fb5dbd5a0f8a9c56a687a97d4dbbd31ede Mon Sep 17 00:00:00 2001 From: Dario Tranchitella Date: Mon, 11 Aug 2025 11:43:20 +0200 Subject: [PATCH] chore(gh): building edge images using workflow dispatch (#905) Signed-off-by: Dario Tranchitella --- .github/workflows/ko-build.yml | 10 ++++++++-- .github/workflows/release.yml | 16 +++++++--------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ko-build.yml b/.github/workflows/ko-build.yml index 66f6fcd..cf9370e 100644 --- a/.github/workflows/ko-build.yml +++ b/.github/workflows/ko-build.yml @@ -7,6 +7,12 @@ on: - v* branches: - master + workflow_dispatch: + inputs: + tag: + description: "Tag to build" + required: true + type: string jobs: ko: @@ -25,7 +31,7 @@ jobs: - name: "ko: login to docker.io container registry" run: ./bin/ko login docker.io -u ${{ secrets.DOCKER_IO_USERNAME }} -p ${{ secrets.DOCKER_IO_TOKEN }} - name: "ko: build and push tag" - run: make VERSION=${{ github.ref_name }} KO_LOCAL=false KO_PUSH=true build - if: startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/tags/edge-') + run: make VERSION=${{ github.event.inputs.tag }} KO_LOCAL=false KO_PUSH=true build + if: github.event_name == 'workflow_dispatch' - name: "ko: build and push latest" run: make VERSION=latest KO_LOCAL=false KO_PUSH=true build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ec6df97..df1453f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,15 +37,6 @@ jobs: run: | export TAG="${{ steps.tag.outputs.tag }}" envsubst < .github/release-template.md > release-notes.md - - name: create and push git tag - env: - WORKFLOW_TOKEN: ${{ secrets.WORKFLOW_TOKEN }} - run: | - git config user.name "github-actions" - git config user.email "github-actions@github.com" - git tag "${{ steps.tag.outputs.tag }}" - git remote set-url origin https://x-access-token:${WORKFLOW_TOKEN}@github.com/${{ github.repository }} - git push origin "${{ steps.tag.outputs.tag }}" - name: generate release notes from template run: | export TAG="${{ steps.tag.outputs.tag }}" @@ -75,3 +66,10 @@ jobs: gh release create "${{ steps.tag.outputs.tag }}" \ --title "${{ steps.tag.outputs.tag }}" \ --notes-file release-notes.md + - name: trigger container build workflow + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh workflow run "Container image build" \ + --ref master \ + -f tag="${{ steps.tag.outputs.tag }}"