From 647491dd992c4087ba1c0eb4e2443d0f9550da46 Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Wed, 6 Mar 2024 08:35:55 +0100 Subject: [PATCH 1/2] ci(docs-release): fix vendoring step Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- .github/workflows/docs-release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docs-release.yml b/.github/workflows/docs-release.yml index 5c6f0edee1b..3251b2e0615 100644 --- a/.github/workflows/docs-release.yml +++ b/.github/workflows/docs-release.yml @@ -43,7 +43,6 @@ jobs: name: Update vendor uses: docker/bake-action@v4 with: - source: ${{ github.server_url }}/${{ github.repository }}.git#${{ github.event.release.name }} targets: vendor set: | vendor.args.MODULE=github.com/docker/buildx@${{ github.event.release.name }} From c1dfa74b981d3997687b5e363ef394bc1c832137 Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Wed, 6 Mar 2024 08:40:30 +0100 Subject: [PATCH 2/2] ci(docs-release): manual trigger support Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- .github/workflows/docs-release.yml | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docs-release.yml b/.github/workflows/docs-release.yml index 3251b2e0615..7a251416d73 100644 --- a/.github/workflows/docs-release.yml +++ b/.github/workflows/docs-release.yml @@ -1,6 +1,11 @@ name: docs-release on: + workflow_dispatch: + inputs: + tag: + description: 'Git tag' + required: true release: types: - released @@ -8,7 +13,7 @@ on: jobs: open-pr: runs-on: ubuntu-22.04 - if: ${{ github.event.release.prerelease != true && github.repository == 'docker/buildx' }} + if: ${{ (github.event.release.prerelease != true || github.event.inputs.tag != '') && github.repository == 'docker/buildx' }} steps: - name: Checkout docs repo @@ -22,6 +27,11 @@ jobs: run: | rm -rf ./data/buildx/* rm -rf ./_vendor/github.com/docker/buildx + if [ -n "${{ github.event.inputs.tag }}" ]; then + echo "RELEASE_NAME=${{ github.event.inputs.tag }}" >> $GITHUB_ENV + else + echo "RELEASE_NAME=${{ github.event.release.name }}" >> $GITHUB_ENV + fi - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -29,7 +39,7 @@ jobs: name: Generate yaml uses: docker/bake-action@v4 with: - source: ${{ github.server_url }}/${{ github.repository }}.git#${{ github.event.release.name }} + source: ${{ github.server_url }}/${{ github.repository }}.git#${{ env.RELEASE_NAME }} targets: update-docs set: | *.output=/tmp/buildx-docs @@ -45,18 +55,18 @@ jobs: with: targets: vendor set: | - vendor.args.MODULE=github.com/docker/buildx@${{ github.event.release.name }} + vendor.args.MODULE=github.com/docker/buildx@${{ env.RELEASE_NAME }} - name: Create PR on docs repo uses: peter-evans/create-pull-request@a4f52f8033a6168103c2538976c07b467e8163bc with: token: ${{ secrets.GHPAT_DOCS_DISPATCH }} push-to-fork: docker-tools-robot/docker.github.io - commit-message: "vendor: github.com/docker/buildx ${{ github.event.release.name }}" + commit-message: "vendor: github.com/docker/buildx ${{ env.RELEASE_NAME }}" signoff: true - branch: dispatch/buildx-ref-${{ github.event.release.name }} + branch: dispatch/buildx-ref-${{ env.RELEASE_NAME }} delete-branch: true - title: Update buildx reference to ${{ github.event.release.name }} + title: Update buildx reference to ${{ env.RELEASE_NAME }} body: | - Update the buildx reference documentation to keep in sync with the latest release `${{ github.event.release.name }}` + Update the buildx reference documentation to keep in sync with the latest release `${{ env.RELEASE_NAME }}` draft: false