From 621f67cd7c2aa2261c03d81f9864e9e17993027a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Mon, 20 Nov 2023 00:26:21 +0100 Subject: [PATCH] chore: fix mike docs (#450) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- .github/workflows/codeql.yaml | 5 +++-- .github/workflows/deploy.yaml | 5 +++-- .github/workflows/release.yaml | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index ea532cb8b..359d9da6b 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -2,8 +2,7 @@ name: CodeQL -permissions: - security-events: write +permissions: {} on: pull_request: @@ -20,6 +19,8 @@ concurrency: jobs: required: runs-on: ubuntu-latest + permissions: + security-events: write steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 65a3fce75..7619e5144 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -2,8 +2,7 @@ name: Deploy -permissions: - contents: write +permissions: {} on: push: @@ -17,6 +16,8 @@ concurrency: jobs: docs: runs-on: ubuntu-latest + permissions: + contents: write steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e5d0c78cb..640b2d58c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -120,3 +120,35 @@ jobs: registry-username: ${{ github.actor }} secrets: registry-password: ${{ secrets.GITHUB_TOKEN }} + + docs: + needs: + - goreleaser + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - name: Parse semver string + id: semver + uses: booxmedialtd/ws-action-parse-semver@7784200024d6b3fc01253e617ec0168daf603de3 # v1.4.7 + with: + input_string: ${{ github.ref_name }} + version_extractor_regex: '\/v(.*)$' + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 + with: + go-version-file: go.mod + cache-dependency-path: go.sum + - name: Build site + run: | + set -e + make codegen-mkdocs + - name: Deploy site + if: ${{ steps.semver.outputs.prerelease == '' }} + run: | + set -e + git fetch origin gh-pages --depth=1 + git config user.name ci-bot + git config user.email ci-bot@example.com + mike deploy -F ./website/mkdocs.yaml --push --update-aliases ${{ steps.semver.outputs.fullversion }} latest