mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #3189 from seanh/publish-to-ghp-using-gha
This commit is contained in:
commit
a23a4e14cf
2 changed files with 167 additions and 13 deletions
60
.github/workflows/github_pages.yml
vendored
Normal file
60
.github/workflows/github_pages.yml
vendored
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
name: Deploy to GitHub Pages
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
settings:
|
||||
required: true
|
||||
description: "The path to your Pelican settings file (`pelican`'s `--settings` option), for example: 'publishconf.py'"
|
||||
type: string
|
||||
requirements:
|
||||
required: false
|
||||
default: "pelican"
|
||||
description: "The Python requirements to install, for example to enable markdown and typogrify use: 'pelican[markdown] typogrify' or if you have a requirements file use: '-r requirements.txt'"
|
||||
type: string
|
||||
output-path:
|
||||
required: false
|
||||
default: "output/"
|
||||
description: "Where to output the generated files (`pelican`'s `--output` option)"
|
||||
type: string
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: false
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.11"
|
||||
- name: Configure GitHub Pages
|
||||
id: pages
|
||||
uses: actions/configure-pages@v3
|
||||
- name: Install requirements
|
||||
run: pip install ${{ inputs.requirements }}
|
||||
- name: Build Pelican site
|
||||
run: |
|
||||
pelican \
|
||||
--settings "${{ inputs.settings }}" \
|
||||
--extra-settings SITEURL='"${{ steps.pages.outputs.base_url }}"' \
|
||||
--output "${{ inputs.output-path }}"
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v2
|
||||
with:
|
||||
path: ${{ inputs.output-path }}
|
||||
deploy:
|
||||
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@v2
|
||||
Loading…
Add table
Add a link
Reference in a new issue