deploy-docs #254
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: Publish Website | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
on: | |
repository_dispatch: | |
types: [deploy-docs] | |
workflow_dispatch: | |
push: | |
branches: main | |
jobs: | |
quarto: | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: "3.9" | |
- name: Install Quarto | |
uses: quarto-dev/quarto-actions/setup@v2 | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Generate tutorial pages | |
run: | | |
pip install --upgrade pip | |
pip install "devito[extras,tests] @ git+https://github.com/devitocodes/devito@master" | |
git clone https://github.com/devitocodes/devito.git | |
cp -r devito/examples examples | |
cp devito/FAQ.md FAQ.qmd | |
# Remove back to top as integrated in all pages of the website | |
sed -i '/^\[top/d' FAQ.qmd | |
# Install quartodoc | |
pip install griffe==0.38.1 | |
pip install git+https://github.com/machow/quartodoc.git | |
quartodoc build | |
- name: Render Website | |
run: quarto render | |
- name: Cleanup | |
run: | | |
rm -rf devito | |
rm -rf examples | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: '_site' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v3 |