mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 02:56: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:
|
jobs:
|
||||||
Extract:
|
Extract:
|
||||||
name: 📓 Extract configurations from pyproject.toml
|
name: 🔬 Extract configurations from pyproject.toml
|
||||||
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
|
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
|
||||||
outputs:
|
outputs:
|
||||||
unittest_report_xml: ${{ steps.getVariables.outputs.unittest_report_xml }}
|
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: ''
|
default: ''
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
github_pages_url:
|
||||||
|
description: "URL to GitHub Pages."
|
||||||
|
value: ${{ jobs.PrepareGitHubPages.outputs.github_pages_url }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
PrepareGitHubPages:
|
||||||
PublishToGitHubPages:
|
name: 📖 Merge multiple contents for publishing
|
||||||
name: 📚 Publish to GH-Pages
|
|
||||||
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
|
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:
|
steps:
|
||||||
- name: ⏬ Checkout repository
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: 📥 Download artifacts '${{ inputs.doc }}' from 'SphinxDocumentation' job
|
- name: 📥 Download artifacts '${{ inputs.doc }}' from 'SphinxDocumentation' job
|
||||||
uses: pyTooling/download-artifact@v7
|
uses: pyTooling/download-artifact@v7
|
||||||
with:
|
with:
|
||||||
@@ -75,15 +83,13 @@ jobs:
|
|||||||
name: ${{ inputs.typing }}
|
name: ${{ inputs.typing }}
|
||||||
path: public/typing
|
path: public/typing
|
||||||
|
|
||||||
- name: '📓 Publish site to GitHub Pages'
|
- name: 📑 Upload static files as artifact
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
run: |
|
uses: actions/upload-pages-artifact@v4
|
||||||
cd public
|
with:
|
||||||
touch .nojekyll
|
path: public/
|
||||||
git init
|
|
||||||
cp ../.git/config ./.git/config
|
- name: 📖 Deploy to GitHub Pages
|
||||||
git add .
|
id: deployment
|
||||||
git config --local user.email "BuildTheDocs@GitHubActions"
|
if: github.event_name != 'pull_request'
|
||||||
git config --local user.name "GitHub Actions"
|
uses: actions/deploy-pages@v4
|
||||||
git commit -a -m "update ${{ github.sha }}"
|
|
||||||
git push -u origin +HEAD:gh-pages
|
|
||||||
|
|||||||
Reference in New Issue
Block a user