From b16b5ebea73bb79f9cc7819ba202931c2dc0c252 Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+ttytm@users.noreply.github.com> Date: Sat, 21 Oct 2023 18:26:38 +0200 Subject: [PATCH] ci: add permissions to deploy docs to gh-pages --- .github/workflows/docs.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 45a208b..a593f12 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -4,10 +4,13 @@ on: push: paths: ['**/*.md', '**/docs.yml'] pull_request: + workflow_dispatch: -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write env: REPO_NAME: ${{ github.event.repository.name }} @@ -32,9 +35,12 @@ jobs: fi check-docs: - runs-on: ubuntu-latest needs: debounce if: needs.debounce.outputs.abort != 'true' + runs-on: ubuntu-latest + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true steps: - name: Restore Cache id: cache-status @@ -63,11 +69,11 @@ jobs: run: v check-md -hide-warnings ${{ env.MOD_PATH }} deploy: + if: github.ref_name == 'main' && github.event_name == 'push' + runs-on: ubuntu-latest concurrency: group: pages cancel-in-progress: false - runs-on: ubuntu-latest - if: github.ref_name == 'main' && github.event_name == 'push' environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }}