From 93756e1ecdbac8567802fec54e8941b56f0b0cb9 Mon Sep 17 00:00:00 2001 From: Damien L-G Date: Thu, 30 Jan 2025 13:00:24 -0500 Subject: [PATCH 01/11] Update action to deploy to GitHub pages This is an attempt to fix the permissions error on the last merge. The code is inspired from https://github.com/actions/upload-pages-artifact --- .github/workflows/deploy_docs.yml | 46 ++++++++++++++----------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index bd373cd11..5c2d97439 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -6,41 +6,35 @@ on: pull_request: jobs: - build-and-deploy-docs: + build: runs-on: ubuntu-latest env: docs-directory: /home/runner/work/kokkos-core-wiki/kokkos-core-wiki/docs - python-version: '3.10' steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ env.python-version }} - uses: actions/setup-python@v4 + - uses: actions/checkout@v4.2.2 + - uses: actions/setup-python@v5.4.0 with: - python-version: ${{ env.python-version }} - architecture: 'x64' - - name: Install Python dependencies - run: | - pip3 install -r build_requirements.txt + python-version: '3.10' + - run: pip install -r build_requirements.txt - name: Build documentation working-directory: ${{ env.docs-directory }} run: | make html - - name: Archive documentation - uses: actions/upload-artifact@v4 + - name: Updload documentation as artifact + id: deployment + uses: actions/upload-pages-artifact@v3.0.1 with: - name: documentation.tar.gz path: ${{ env.docs-directory }}/generated_docs - # .nojekyll file is needed for GitHub Pages to know it's getting a ready webpage - # and there is no need to generate anything - - name: Generate nojekyll file - working-directory: ${{ env.docs-directory }}/generated_docs - run: touch .nojekyll - # This action moves the content of `generated_docs` to the `deploy-doc-site` branch - - name: Deploy docs - if: ${{ github.ref == 'refs/heads/main' }} - uses: JamesIves/github-pages-deploy-action@v4 - with: - branch: deploy-doc-site - folder: ${{ env.docs-directory }}/generated_docs - clean: true + + deploy: + if: ${{ github.ref == 'refs/heads/main' }} + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4.0.5 From 2e83eface79d5aa33c1664bc067b9fe533a5dee8 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 30 Jan 2025 13:22:28 -0500 Subject: [PATCH 02/11] Revert "Update action to deploy to GitHub pages" This reverts commit 93756e1ecdbac8567802fec54e8941b56f0b0cb9. --- .github/workflows/deploy_docs.yml | 46 +++++++++++++++++-------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index 5c2d97439..bd373cd11 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -6,35 +6,41 @@ on: pull_request: jobs: - build: + build-and-deploy-docs: runs-on: ubuntu-latest env: docs-directory: /home/runner/work/kokkos-core-wiki/kokkos-core-wiki/docs + python-version: '3.10' steps: - - uses: actions/checkout@v4.2.2 - - uses: actions/setup-python@v5.4.0 + - uses: actions/checkout@v3 + - name: Set up Python ${{ env.python-version }} + uses: actions/setup-python@v4 with: - python-version: '3.10' - - run: pip install -r build_requirements.txt + python-version: ${{ env.python-version }} + architecture: 'x64' + - name: Install Python dependencies + run: | + pip3 install -r build_requirements.txt - name: Build documentation working-directory: ${{ env.docs-directory }} run: | make html - - name: Updload documentation as artifact - id: deployment - uses: actions/upload-pages-artifact@v3.0.1 + - name: Archive documentation + uses: actions/upload-artifact@v4 with: + name: documentation.tar.gz path: ${{ env.docs-directory }}/generated_docs - - deploy: - if: ${{ github.ref == 'refs/heads/main' }} - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4.0.5 + # .nojekyll file is needed for GitHub Pages to know it's getting a ready webpage + # and there is no need to generate anything + - name: Generate nojekyll file + working-directory: ${{ env.docs-directory }}/generated_docs + run: touch .nojekyll + # This action moves the content of `generated_docs` to the `deploy-doc-site` branch + - name: Deploy docs + if: ${{ github.ref == 'refs/heads/main' }} + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: deploy-doc-site + folder: ${{ env.docs-directory }}/generated_docs + clean: true From dee1b5eed20dc7ddc27801f843ec518441f1d35f Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 30 Jan 2025 13:25:26 -0500 Subject: [PATCH 03/11] Grant more permissions --- .github/workflows/deploy_docs.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index bd373cd11..106ce31f9 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -5,6 +5,9 @@ on: branches: [ main ] pull_request: +permissions: + contents: write + jobs: build-and-deploy-docs: runs-on: ubuntu-latest @@ -26,7 +29,7 @@ jobs: working-directory: ${{ env.docs-directory }} run: | make html - - name: Archive documentation + - name: Archivei documentation uses: actions/upload-artifact@v4 with: name: documentation.tar.gz @@ -38,7 +41,6 @@ jobs: run: touch .nojekyll # This action moves the content of `generated_docs` to the `deploy-doc-site` branch - name: Deploy docs - if: ${{ github.ref == 'refs/heads/main' }} uses: JamesIves/github-pages-deploy-action@v4 with: branch: deploy-doc-site From 622ebb46757975ba1fc43c2a9139376a58e91614 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 30 Jan 2025 13:29:44 -0500 Subject: [PATCH 04/11] Try setting permissions on the job level --- .github/workflows/deploy_docs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index 106ce31f9..605e37d59 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -14,6 +14,8 @@ jobs: env: docs-directory: /home/runner/work/kokkos-core-wiki/kokkos-core-wiki/docs python-version: '3.10' + permissions: + contents: write steps: - uses: actions/checkout@v3 From 4f259ab634b6254d32ad5bfd3fd7e53d78ddfceb Mon Sep 17 00:00:00 2001 From: Damien L-G Date: Thu, 30 Jan 2025 13:00:24 -0500 Subject: [PATCH 05/11] Update action to deploy to GitHub pages This is an attempt to fix the permissions error on the last merge. The code is inspired from https://github.com/actions/upload-pages-artifact --- .github/workflows/deploy_docs.yml | 50 +++++++++++++------------------ 1 file changed, 20 insertions(+), 30 deletions(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index 605e37d59..5c2d97439 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -5,46 +5,36 @@ on: branches: [ main ] pull_request: -permissions: - contents: write - jobs: - build-and-deploy-docs: + build: runs-on: ubuntu-latest env: docs-directory: /home/runner/work/kokkos-core-wiki/kokkos-core-wiki/docs - python-version: '3.10' - permissions: - contents: write steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ env.python-version }} - uses: actions/setup-python@v4 + - uses: actions/checkout@v4.2.2 + - uses: actions/setup-python@v5.4.0 with: - python-version: ${{ env.python-version }} - architecture: 'x64' - - name: Install Python dependencies - run: | - pip3 install -r build_requirements.txt + python-version: '3.10' + - run: pip install -r build_requirements.txt - name: Build documentation working-directory: ${{ env.docs-directory }} run: | make html - - name: Archivei documentation - uses: actions/upload-artifact@v4 + - name: Updload documentation as artifact + id: deployment + uses: actions/upload-pages-artifact@v3.0.1 with: - name: documentation.tar.gz path: ${{ env.docs-directory }}/generated_docs - # .nojekyll file is needed for GitHub Pages to know it's getting a ready webpage - # and there is no need to generate anything - - name: Generate nojekyll file - working-directory: ${{ env.docs-directory }}/generated_docs - run: touch .nojekyll - # This action moves the content of `generated_docs` to the `deploy-doc-site` branch - - name: Deploy docs - uses: JamesIves/github-pages-deploy-action@v4 - with: - branch: deploy-doc-site - folder: ${{ env.docs-directory }}/generated_docs - clean: true + + deploy: + if: ${{ github.ref == 'refs/heads/main' }} + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4.0.5 From 9fe0406024e069a1a774440e76af2c818cb176cd Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 30 Jan 2025 13:48:05 -0500 Subject: [PATCH 06/11] Combine --- .github/workflows/deploy_docs.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index 5c2d97439..deecde368 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest env: docs-directory: /home/runner/work/kokkos-core-wiki/kokkos-core-wiki/docs - + url: ${{ steps.deployment.outputs.page_url }} steps: - uses: actions/checkout@v4.2.2 - uses: actions/setup-python@v5.4.0 @@ -26,15 +26,6 @@ jobs: uses: actions/upload-pages-artifact@v3.0.1 with: path: ${{ env.docs-directory }}/generated_docs - - deploy: - if: ${{ github.ref == 'refs/heads/main' }} - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build - steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4.0.5 From 48a5614b3e55004c1ad8c9fc45020a8aa906a065 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 30 Jan 2025 13:56:44 -0500 Subject: [PATCH 07/11] Set permissions --- .github/workflows/deploy_docs.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index deecde368..4cc8362df 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -26,6 +26,17 @@ jobs: uses: actions/upload-pages-artifact@v3.0.1 with: path: ${{ env.docs-directory }}/generated_docs + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4.0.5 From ca1cc5f2443c3f27e1fd2272319d6a2a0f788cf7 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 30 Jan 2025 14:03:53 -0500 Subject: [PATCH 08/11] Fix --- .github/workflows/deploy_docs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index 4cc8362df..821f52403 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -10,7 +10,6 @@ jobs: runs-on: ubuntu-latest env: docs-directory: /home/runner/work/kokkos-core-wiki/kokkos-core-wiki/docs - url: ${{ steps.deployment.outputs.page_url }} steps: - uses: actions/checkout@v4.2.2 - uses: actions/setup-python@v5.4.0 From 1baf37ffb588d739fe745e5344f4660ecbee5af0 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 30 Jan 2025 14:49:00 -0500 Subject: [PATCH 09/11] Fix artifact name --- .github/workflows/deploy_docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index 821f52403..54657411a 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -24,6 +24,7 @@ jobs: id: deployment uses: actions/upload-pages-artifact@v3.0.1 with: + name: github-pages path: ${{ env.docs-directory }}/generated_docs deploy: From a1d90c7e900833191c85e0623a751190f5b93c34 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 30 Jan 2025 16:15:15 -0500 Subject: [PATCH 10/11] set contents read --- .github/workflows/deploy_docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index 54657411a..252a37e13 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -34,6 +34,7 @@ jobs: runs-on: ubuntu-latest needs: build permissions: + contents: read pages: write # to deploy to Pages id-token: write # to verify the deployment originates from an appropriate source steps: From 98e7f5b0ff97a8b46f14f1ea2da7fc548c26326b Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Tue, 4 Feb 2025 16:02:01 -0500 Subject: [PATCH 11/11] Only run on merge commits --- .github/workflows/deploy_docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index 252a37e13..17efcb6f2 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -28,6 +28,7 @@ jobs: path: ${{ env.docs-directory }}/generated_docs deploy: + if: ${{ github.ref == 'refs/heads/main' }} environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }}