https://github.com/rehanhaider/pelican-to-github-pages
Automated deployment of Pelican SSG generated static websites to GitHub Pages
https://github.com/rehanhaider/pelican-to-github-pages
deployment github-pages pelican python3
Last synced: 2 months ago
JSON representation
Automated deployment of Pelican SSG generated static websites to GitHub Pages
- Host: GitHub
- URL: https://github.com/rehanhaider/pelican-to-github-pages
- Owner: rehanhaider
- License: mit
- Created: 2021-07-10T14:23:24.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-06T08:50:52.000Z (almost 2 years ago)
- Last Synced: 2025-05-18T06:47:41.815Z (11 months ago)
- Topics: deployment, github-pages, pelican, python3
- Language: Shell
- Homepage:
- Size: 13.7 KB
- Stars: 15
- Watchers: 1
- Forks: 13
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Deploy Pelican to Github Pages
Automated deployment of Pelican SSG generated static websites to GitHub Pages.
GitHub Pages can serve webpages from three predefined places
1. **main/root**: The root folder of the main branch
2. **main/docs**: Doc folder in the main branch
2. **gh-pages/root**: The root folder of any branch named "gh-pages"
## Prerequisites
1. Your working directory should be in the `main` branch of your repository.
2. Ensure you have captured your dependencies in `requirements.txt`. If not you can run the below command
```bash
pip freeze > requirements.txt
```
## Steps to use
First create a file named at the path `.github/.workflows/pelican.yml`
The conents of the file should be
```yaml
name: Deploy
on:
# Trigger the workflow on push on main branch,
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'true'
- uses: rehanhaider/pelican-to-github-pages@v1.0.3
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GH_PAGES_CNAME: ${{secrets.DOMAIN_CNAME}}
```
Then, setup a secrets in your repository named `DOMAIN_CNAME` that should contain the URL of your custom domain without the protocol, e.g. `example.com`. This is only required if you have a custom domain, if you want to use the `*.github.io` subdomain, then you don't need this.
## Default configuration and overrides
This GitHub action will generate the static website using the following defaults
1. Configuration: Using `publishconf.py` as the default configuration file
2. Content: Uses `content` as the default content directory
You can override them by adding the following in the pelican.yml file under env variables
```yaml
PELICAN_CONFIG_FILE: config-file-name
PELICAN_CONTENT_FOLDER: content-folder-name