diff --git a/.github/workflows/build-publish.yaml b/.github/workflows/build-publish.yaml index 647f7a49c..524b61b2a 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: @@ -117,13 +126,18 @@ 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 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: