Bump CDCgov/cfa-actions from 1.0.0 to 1.0.1 #57
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: sphinx | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
# Setting up the environment | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Set up Quarto | |
uses: quarto-dev/quarto-actions/setup@v2 | |
with: | |
version: 1.4.515 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
# - name: Install Poetry | |
# run: pip install poetry | |
- name: Install Sphinx | |
run: pip install sphinx | |
- name: Install the package | |
run: pip install ".[doc]" | |
# Building | |
- name: Render Quarto File | |
run: | | |
quarto render README.qmd --to md | |
mv README.md docs/index.md | |
- name: Build HTML using Sphinx | |
run: sphinx-build -M html docs docs/build/ | |
- name: Move Assets into Place | |
run: mv README_files docs/build/html | |
# Upload | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
name: github-pages | |
path: docs/build/html/ | |
post-page-artifact: | |
if: ${{ github.event_name == 'pull_request' }} | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Post comment preview | |
uses: CDCgov/cfa-actions/[email protected] | |
with: | |
artifact-name: github-pages | |
gh-token: ${{ secrets.GITHUB_TOKEN}} | |
message: "Thanks for your contribution, ${{ github.actor }}; your `{ artifact-name }` is ready for download [here]({ artifact-url })." | |
deploy: | |
# Deploy to the github-pages environment | |
# but not on PRs | |
if: ${{ github.event_name != 'pull_request' }} | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
needs: build | |
# Specify runner + deployment step | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
with: | |
artifact_name: github-pages | |
preview: true # Not yet available to the public. |