github.com/pdmccormick/importable-docker-buildx@v0.0.0-20240426161518-e47091289030/.github/workflows/docs-release.yml (about)

     1  name: docs-release
     2  
     3  on:
     4    workflow_dispatch:
     5      inputs:
     6        tag:
     7          description: 'Git tag'
     8          required: true
     9    release:
    10      types:
    11        - released
    12  
    13  jobs:
    14    open-pr:
    15      runs-on: ubuntu-22.04
    16      if: ${{ (github.event.release.prerelease != true || github.event.inputs.tag != '') && github.repository == 'docker/buildx' }}
    17      steps:
    18        -
    19          name: Checkout docs repo
    20          uses: actions/checkout@v4
    21          with:
    22            token: ${{ secrets.GHPAT_DOCS_DISPATCH }}
    23            repository: docker/docs
    24            ref: main
    25        -
    26          name: Prepare
    27          run: |
    28            rm -rf ./data/buildx/*
    29            if [ -n "${{ github.event.inputs.tag }}" ]; then
    30              echo "RELEASE_NAME=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
    31            else
    32              echo "RELEASE_NAME=${{ github.event.release.name }}" >> $GITHUB_ENV
    33            fi
    34        -
    35          name: Set up Docker Buildx
    36          uses: docker/setup-buildx-action@v3
    37        -
    38          name: Generate yaml
    39          uses: docker/bake-action@v4
    40          with:
    41            source: ${{ github.server_url }}/${{ github.repository }}.git#${{ env.RELEASE_NAME }}
    42            targets: update-docs
    43            provenance: false
    44            set: |
    45              *.output=/tmp/buildx-docs
    46          env:
    47            DOCS_FORMATS: yaml
    48        -
    49          name: Copy yaml
    50          run: |
    51            cp /tmp/buildx-docs/out/reference/*.yaml ./data/buildx/
    52        -
    53          name: Update vendor
    54          run: |
    55            make vendor
    56          env:
    57            VENDOR_MODULE: github.com/docker/buildx@${{ env.RELEASE_NAME }}
    58        -
    59          name: Create PR on docs repo
    60          uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e  # v6.0.5
    61          with:
    62            token: ${{ secrets.GHPAT_DOCS_DISPATCH }}
    63            push-to-fork: docker-tools-robot/docker.github.io
    64            commit-message: "vendor: github.com/docker/buildx ${{ env.RELEASE_NAME }}"
    65            signoff: true
    66            branch: dispatch/buildx-ref-${{ env.RELEASE_NAME }}
    67            delete-branch: true
    68            title: Update buildx reference to ${{ env.RELEASE_NAME }}
    69            body: |
    70              Update the buildx reference documentation to keep in sync with the latest release `${{ env.RELEASE_NAME }}`
    71            draft: false