Merge pull request #14 from altwalker/dependabot/github_actions/devel… #29
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: Docs | |
on: | |
push: | |
branches: [main, develop] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install doc8 | |
run: | | |
pip install doc8 | |
- name: Lint docs with doc8 | |
run: doc8 docs | |
build: | |
runs-on: ubuntu-latest | |
needs: lint | |
strategy: | |
matrix: | |
branch: [main, develop] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ matrix.branch }} | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Install npm dependencies | |
run: | | |
npm install | |
- name: Build | |
run: | | |
npm run build | |
- name: Upload build | |
uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: build-${{ matrix.branch }} | |
path: 'public/' | |
build-docs: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: altwalker/setup-graphwalker@v1 | |
with: | |
python-version: '3.9' | |
- name: Install npm dependencies | |
run: | | |
npm install -g [email protected] | |
- name: Install pip dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Build docs | |
run: | | |
cd docs | |
make html | |
- uses: actions/download-artifact@v3 | |
with: | |
name: build-main | |
path: 'docs/_build/html/build' | |
- uses: actions/download-artifact@v3 | |
with: | |
name: build-develop | |
path: 'docs/_build/html/build-dev' | |
- name: Upload artifact | |
if: github.ref == 'refs/heads/main' | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: 'docs/_build/html/' | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build-docs | |
if: github.ref == 'refs/heads/main' | |
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@v4 |