mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 11:06:56 +08:00
Deploy GitHub pages using an Action instead of a special branch.
This commit is contained in:
2
.github/workflows/ExtractConfiguration.yml
vendored
2
.github/workflows/ExtractConfiguration.yml
vendored
@@ -68,7 +68,7 @@ on:
|
||||
|
||||
jobs:
|
||||
Extract:
|
||||
name: 📓 Extract configurations from pyproject.toml
|
||||
name: 🔬 Extract configurations from pyproject.toml
|
||||
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
|
||||
outputs:
|
||||
unittest_report_xml: ${{ steps.getVariables.outputs.unittest_report_xml }}
|
||||
|
||||
42
.github/workflows/PublishToGitHubPages.yml
vendored
42
.github/workflows/PublishToGitHubPages.yml
vendored
@@ -45,16 +45,24 @@ on:
|
||||
default: ''
|
||||
type: string
|
||||
|
||||
outputs:
|
||||
github_pages_url:
|
||||
description: "URL to GitHub Pages."
|
||||
value: ${{ jobs.PrepareGitHubPages.outputs.github_pages_url }}
|
||||
|
||||
jobs:
|
||||
|
||||
PublishToGitHubPages:
|
||||
name: 📚 Publish to GH-Pages
|
||||
PrepareGitHubPages:
|
||||
name: 📖 Merge multiple contents for publishing
|
||||
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
|
||||
|
||||
permissions:
|
||||
pages: write # to deploy to Pages
|
||||
id-token: write # to verify the deployment originates from an appropriate source
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
outputs:
|
||||
github_pages_url: ${{ steps.deployment.outputs.page_url }}
|
||||
steps:
|
||||
- name: ⏬ Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: 📥 Download artifacts '${{ inputs.doc }}' from 'SphinxDocumentation' job
|
||||
uses: pyTooling/download-artifact@v7
|
||||
with:
|
||||
@@ -75,15 +83,13 @@ jobs:
|
||||
name: ${{ inputs.typing }}
|
||||
path: public/typing
|
||||
|
||||
- name: '📓 Publish site to GitHub Pages'
|
||||
- name: 📑 Upload static files as artifact
|
||||
if: github.event_name != 'pull_request'
|
||||
run: |
|
||||
cd public
|
||||
touch .nojekyll
|
||||
git init
|
||||
cp ../.git/config ./.git/config
|
||||
git add .
|
||||
git config --local user.email "BuildTheDocs@GitHubActions"
|
||||
git config --local user.name "GitHub Actions"
|
||||
git commit -a -m "update ${{ github.sha }}"
|
||||
git push -u origin +HEAD:gh-pages
|
||||
uses: actions/upload-pages-artifact@v4
|
||||
with:
|
||||
path: public/
|
||||
|
||||
- name: 📖 Deploy to GitHub Pages
|
||||
id: deployment
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: actions/deploy-pages@v4
|
||||
|
||||
Reference in New Issue
Block a user