Bump docker/metadata-action from 60a0d343a0d8a18aedee9d34e62251f752153bdb to bd26c982ee2b6c0f9744591c74c527e8a669f72f #257
Workflow file for this run
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: | |
pull_request: | |
branches: [main] | |
types: [opened, synchronize, closed] | |
jobs: | |
build: | |
runs-on: ${{ (github.event_name == 'pull_request' && github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')) && fromJSON('["self-hosted", "db", "cyclops"]') || 'ubuntu-latest' }} | |
steps: | |
- uses: actions/[email protected] | |
with: | |
submodules: 'true' | |
fetch-depth: 0 | |
- name: Install poetry | |
run: python3 -m pip install --upgrade pip && python3 -m pip install poetry | |
- uses: actions/[email protected] | |
with: | |
python-version: '3.10' | |
cache: 'poetry' | |
- name: Install dependencies | |
run: | | |
poetry env use '3.10' | |
poetry install --with docs,test --all-extras | |
- name: Build docs | |
run: | | |
source $(poetry env info --path)/bin/activate | |
cd docs | |
rm -rf source/reference/api/_autosummary | |
if [[ "${{ github.event_name == 'pull_request' && github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release') }}" == "true" ]]; then | |
make html-with-notebooks | |
else | |
make html | |
fi | |
- name: Set up Node.js | |
uses: actions/[email protected] | |
with: | |
node-version: 18 | |
cache: yarn | |
cache-dependency-path: '**/yarn.lock' | |
- name: Build webpage | |
run: | | |
cd docs/cyclops-webpage | |
yarn install --frozen-lockfile | |
yarn build | |
cp -r ../build/html build/api | |
- name: Create .nojekyll file | |
run: touch ./docs/cyclops-webpage/build/.nojekyll | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
if: github.event_name == 'pull_request' && github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release') | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_branch: github_pages | |
publish_dir: ./docs/cyclops-webpage/build | |
force_orphan: true |