ci: build and publish documentation #11
Workflow file for this run
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: 📖 Documentation | |
on: | |
pull_request: | |
# on pull request we just want to build | |
push: | |
# on merge to main, build and publish | |
# FIXME: remove ci-generate-docs before merging ! | |
branches: [ "main" ] | |
jobs: | |
documentation: | |
name: Documentation | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: ensure we have a config file | |
run: | | |
sed -i -e 's!CONFIG_PATH=!CONFIG_PATH=data/config/openfoodfacts.yml!' .env | |
# generating project documentation | |
- name: Build documentation with MkDocs | |
run: | | |
./scripts/generate_doc.sh | |
- name: Deploy documentation to GitHub Pages | |
uses: JamesIves/[email protected] | |
# we only deploy on push to main | |
if: | | |
github.event_name == 'push' && github.event.ref == 'refs/heads/main' | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
branch: "gh-pages" | |
folder: gh_pages |