Skip to content

Plan for SPM app def. #1004

Plan for SPM app def.

Plan for SPM app def. #1004

name: GH pages fairmat proposal
on:
push:
branches: [fairmat]
pull_request:
branches: [fairmat]
jobs:
pages:
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: install dependencies
run: pip install -r requirements.txt
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v7
- name: test
run: make test
- name: prepare
run: make prepare
- name: html
run: make html
- name: Remove build artifacts
run: rm -rf build/manual/build/html/.doctrees build/manual/build/html/_sources
- name: Checkout fairmat-docs branch
run: |
git fetch origin fairmat-docs
git checkout fairmat-docs || git checkout --orphan fairmat-docs
- name: Move default branch build into fairmat-docs
if: steps.branch-name.outputs.is_default == 'true'
run: |
mkdir -p docs
cp -r build/manual/build/html/* docs
rm -R build/manual/build/html/*
- name: Move PR build into fairmat-docs
if: steps.branch-name.outputs.is_default == 'false'
run: |
mkdir -p docs/${{ steps.branch-name.outputs.current_branch }}
cp -r build/manual/build/html/* docs/${{ steps.branch-name.outputs.current_branch }}
rm -R build/manual/build/html/*
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs
publish_branch: fairmat-docs
destination_dir: docs
force_orphan: true