contact us #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate documentation in GitHub Pages | |
# Execute this workflow automatically for every push to master | |
on: | |
push: | |
branches: [main] | |
jobs: | |
build_docs: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
- name: Set up Python | |
uses: actions/setup-python@main | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: python -m pip install -r requirements.txt | |
- name: Make the sphinx docs | |
run: | | |
make -C docs clean | |
make -C docs html | |
- name: Init new repo in dist folder and commit generated files | |
run: | | |
# Move to html directory | |
cd docs/_build/html/ | |
# Copy README file | |
cp ${{ github.workspace }}/README.md . | |
# Copy custom css, templates, and images | |
cp -r ${{ github.workspace }}/_static/* _static/ | |
cp -r ${{ github.workspace }}/_templates . | |
# Initialize repository, and commit changes | |
git init | |
touch .nojekyll | |
git add -A | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git commit -m 'deploy' | |
- name: Force push to destination branch | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: gh-pages | |
force: true | |
directory: ./docs/_build/html |