Git fetch indexed (#308) #3
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: "PreTeXt" | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: "Compile" | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: "Checkout repository" | |
uses: actions/checkout@v3 | |
- name: Setup GitHub Pages | |
id: pages | |
uses: actions/configure-pages@v3 | |
if: github.ref == 'refs/heads/main' | |
- name: "Setup Python" | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
cache: "pip" | |
- name: "Install PreTeXt" | |
run: pip install -r requirements.txt | |
- name: "Compile book" | |
run: pretext build web | |
- name: Upload GitHub Pages artifact | |
uses: actions/upload-pages-artifact@v1 | |
if: github.ref == 'refs/heads/main' | |
with: | |
path: "output/web/" | |
deploy: | |
name: "Publish" | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: "Deploy to GitHub Pages" | |
id: deployment | |
uses: actions/deploy-pages@v2 |