Skip to content

Commit e5a8748

Browse files
committed
Deploy GitHub pages using an Action instead of a special branch.
1 parent 1837930 commit e5a8748

File tree

2 files changed

+25
-19
lines changed

2 files changed

+25
-19
lines changed

.github/workflows/ExtractConfiguration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ on:
6868

6969
jobs:
7070
Extract:
71-
name: 📓 Extract configurations from pyproject.toml
71+
name: 🔬 Extract configurations from pyproject.toml
7272
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
7373
outputs:
7474
unittest_report_xml: ${{ steps.getVariables.outputs.unittest_report_xml }}

.github/workflows/PublishToGitHubPages.yml

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,24 @@ on:
4545
default: ''
4646
type: string
4747

48-
jobs:
48+
outputs:
49+
github_pages_url:
50+
description: "URL to GitHub Pages."
51+
value: ${{ jobs.PrepareGitHubPages.outputs.github_pages_url }}
4952

50-
PublishToGitHubPages:
51-
name: 📚 Publish to GH-Pages
53+
jobs:
54+
PrepareGitHubPages:
55+
name: 📖 Merge multiple contents for publishing
5256
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
53-
57+
permissions:
58+
pages: write # to deploy to Pages
59+
id-token: write # to verify the deployment originates from an appropriate source
60+
environment:
61+
name: github-pages
62+
url: ${{ steps.deployment.outputs.page_url }}
63+
outputs:
64+
github_pages_url: ${{ steps.deployment.outputs.page_url }}
5465
steps:
55-
- name: ⏬ Checkout repository
56-
uses: actions/checkout@v6
57-
5866
- name: 📥 Download artifacts '${{ inputs.doc }}' from 'SphinxDocumentation' job
5967
uses: pyTooling/download-artifact@v7
6068
with:
@@ -75,15 +83,13 @@ jobs:
7583
name: ${{ inputs.typing }}
7684
path: public/typing
7785

78-
- name: '📓 Publish site to GitHub Pages'
86+
- name: 📑 Upload static files as artifact
87+
if: github.event_name != 'pull_request'
88+
uses: actions/upload-pages-artifact@v4
89+
with:
90+
path: public/
91+
92+
- name: 📖 Deploy to GitHub Pages
93+
id: deployment
7994
if: github.event_name != 'pull_request'
80-
run: |
81-
cd public
82-
touch .nojekyll
83-
git init
84-
cp ../.git/config ./.git/config
85-
git add .
86-
git config --local user.email "BuildTheDocs@GitHubActions"
87-
git config --local user.name "GitHub Actions"
88-
git commit -a -m "update ${{ github.sha }}"
89-
git push -u origin +HEAD:gh-pages
95+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)