From f4166567309228c38e15509e4adc032c3e2106b0 Mon Sep 17 00:00:00 2001 From: beniaminmunteanu Date: Thu, 10 Apr 2025 18:57:04 +0300 Subject: [PATCH 1/2] feat(workflows): add manual trigger --- .github/workflows/build-publish.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-publish.yaml b/.github/workflows/build-publish.yaml index 647f7a49c..11ab9484d 100644 --- a/.github/workflows/build-publish.yaml +++ b/.github/workflows/build-publish.yaml @@ -9,6 +9,13 @@ on: - main tags: - 'v[0-9]+.[0-9]+.[0-9]+' + workflow_dispatch: + inputs: + branch: + description: 'Branch to publish from' + required: true + type: string + default: 'main' jobs: build: @@ -45,7 +52,9 @@ jobs: runs-on: ubuntu-latest needs: build timeout-minutes: 15 - if: startsWith(github.ref, 'refs/tags/v') + if: | + startsWith(github.ref, 'refs/tags/v') || + github.event_name == 'workflow_dispatch' strategy: matrix: package: @@ -123,7 +132,9 @@ jobs: runs-on: ubuntu-latest needs: publish timeout-minutes: 5 - if: startsWith(github.ref, 'refs/tags/v') + if: | + startsWith(github.ref, 'refs/tags/v') && + github.event_name != 'workflow_dispatch' permissions: contents: write steps: From b9dd909c0b371df206369e2166c8ab7ad3256987 Mon Sep 17 00:00:00 2001 From: beniaminmunteanu Date: Thu, 10 Apr 2025 19:07:07 +0300 Subject: [PATCH 2/2] fix(workflows): fix so latest image would not get poluted --- .github/workflows/build-publish.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-publish.yaml b/.github/workflows/build-publish.yaml index 11ab9484d..524b61b2a 100644 --- a/.github/workflows/build-publish.yaml +++ b/.github/workflows/build-publish.yaml @@ -126,7 +126,10 @@ jobs: ${{ matrix.package.identifier == 'wallet:frontend' && format('NEXT_PUBLIC_AUTH_HOST={0}', matrix.package.auth_host) || '' }} ${{ matrix.package.identifier == 'wallet:frontend' && format('NEXT_PUBLIC_GATEHUB_ENV={0}', matrix.package.gatehub_env) || '' }} ${{ matrix.package.identifier == 'wallet:frontend' && format('NEXT_PUBLIC_THEME={0}', matrix.package.theme) || '' }} - tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.package.name }}:${{ github.ref_name }},ghcr.io/${{ github.repository_owner }}/${{ matrix.package.name }}:latest + tags: | + ${{ github.event_name == 'workflow_dispatch' && + 'ghcr.io/${{ github.repository_owner }}/${{ matrix.package.name }}:${{ github.ref_name }}' || + 'ghcr.io/${{ github.repository_owner }}/${{ matrix.package.name }}:${{ github.ref_name }},ghcr.io/${{ github.repository_owner }}/${{ matrix.package.name }}:latest' }} generate-release: runs-on: ubuntu-latest