-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (61 loc) · 2.11 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# 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