Merge updates from https://github.com/nfdi4cat/voc4cat-template #15
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
# This action runs when a release is created and on merges to main. | |
# | |
# Workflow steps: | |
# - build docs | |
# - create excel-file from turtle | |
# - publish docs and excel-file to gh-pages | |
name: Build & Publish | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- v[0-9]+.[0-9]+.[0-9]+ | |
workflow_dispatch: | |
env: | |
FORCE_COLOR: "1" # Make tool output pretty. | |
PIP_DISABLE_PIP_VERSION_CHECK: "1" | |
PIP_PROGRESS_BAR: "off" | |
jobs: | |
build: | |
name: Build vocabulary & documentation | |
permissions: | |
# Required for peaceiris/actions-gh-pages below | |
contents: write | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -VV | |
python -m pip install --upgrade pip setuptools wheel | |
python -m pip install git+https://github.com/nfdi4cat/voc4cat-tool.git@main | |
- name: Run voc4cat to build docs & Excel-files matching turtle files | |
run: | | |
voc4cat --version | |
voc4cat --docs pylode --output-directory publish vocabularies/ | |
voc4cat --output-directory publish vocabularies/ --template templates/voc4cat_template_043.xlsx | |
ls -l publish/ || echo "publish directory does not exist." | |
- name: Deploy documentation | |
# Pin third party action (v3.9.3) | |
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
with: | |
publish_branch: gh-pages | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./publish | |
force_orphan: true | |
- name: Store xlsx file(s) as artifacts | |
# This step is not required and may be removed. The xlsx files are | |
# stored in gh-pages and can be linked which makes them easier to find. | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: voc4cat-excel-vocab | |
path: publish/*.xlsx | |
# Lit: | |
# https://github.com/peaceiris/actions-gh-pages |