Skip to content

Commit

Permalink
Update cd_update_pages workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jesper-friis committed Nov 6, 2024
1 parent 0c5f0bb commit 543bd0a
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 62 deletions.
67 changes: 35 additions & 32 deletions .github/workflows/cd_update_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,28 @@ on:
push:
branches:
- main
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-*'
tags:
- 'v*.*.*'

env:
GIT_USER_NAME: CHAMEO Developers
GIT_USER_EMAIL: "[email protected]"

jobs:

build:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Debug info
run: |
echo "GITHUB_REF_NAME=${GITHUB_REF_NAME}"
echo GITHUB_REF_NAME=${GITHUB_REF_NAME}
- name: Setup Python 3.11
uses: actions/setup-python@v5
Expand Down Expand Up @@ -67,36 +70,13 @@ tl
run: |
ontodoc \
--iri-regex=https://w3id.org/emmo/domain/characterisation-methodology/chameo \
chameo.ttl \
public/chameo-inferred.ttl \
build/chameo.rst
sphinx-build "build/" "public/"
- name: Checkout GitHub Pages for EMMO-repo
uses: actions/checkout@v4
with:
repository: emmo-repo/emmo-repo.github.io/domain-characterisation-methodology/
path: pages
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
ssh-strict: no

- name: Copy to GitHub Pages
run: |
# Do not overwrite index.html
rm public/index.html
# Tell GitHub that this site is not generated with jekyll
touch public/.nojekyll
# Copy to latest (root)
cp -rf public/* pages/.
# Copy to version
VERSION=$(git rev-parse --abbrev-ref HEAD)
if [ ! -d pages/versions/${VERSION} ]; then \
mkdir pages/versions/${VERSION}
fi
cp -rf public/* pages/versions/${VERSION}/.
- name: Publish
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
- name: Publish on GitHub Pages
uses: peaceiris/actions-gh-pages@v4
#if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
Expand All @@ -105,6 +85,29 @@ tl
#publish_branch: main
#force_orphan: true

# - name: Checkout GitHub Pages for EMMO-repo
# uses: actions/checkout@v4
# with:
# repository: emmo-repo/emmo-repo.github.io/domain-characterisation-methodology/
# path: pages
# ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
# ssh-strict: no
#
# - name: Copy to GitHub Pages
# run: |
# # Do not overwrite index.html
# rm public/index.html
# # Tell GitHub that this site is not generated with jekyll
# touch public/.nojekyll
# # Copy to latest (root)
# cp -rf public/* pages/.
# # Copy to version
# VERSION=$(git rev-parse --abbrev-ref HEAD)
# if [ ! -d pages/versions/${VERSION} ]; then \
# mkdir pages/versions/${VERSION}
# fi
# cp -rf public/* pages/versions/${VERSION}/.

# # Domain repositories can use peaceiris/actions-gh-pages@v3.
# # However, since EMMO for historical reasons uses a separate repo
# # for its GitHub Pages, it is easier to use git directly.
Expand Down
75 changes: 45 additions & 30 deletions .github/workflows/ci_ontodoc.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,48 @@
name: Generate documentation
on: [push]

jobs:

ontodoc:
runs-on: ubuntu-20.04
strategy:
max-parallel: 1
matrix:
python-version: [3.11]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install pandoc
run: |
#sudo apt-get install -y pandoc graphviz texlive-xetex texlive-xetex-extra
sudo apt-get install -y pandoc graphviz
- name: Install EMMOntoPy
run: |
pip install --upgrade pip
pip install EMMOntoPy
- name: Generate documentation
run: |
cd doc
ontodoc --template=chameo.md --format=html ../chameo.ttl chameo.html
# Old documentation - comment out for now...
#
#
# jobs:
#
# ontodoc:
# runs-on: ubuntu-20.04
# strategy:
# max-parallel: 1
# matrix:
# python-version: [3.11]
#
# steps:
# - uses: actions/checkout@v4
#
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
#
# - name: Install pandoc
# run: |
# #sudo apt-get install -y pandoc graphviz texlive-xetex texlive-xetex-extra
# sudo apt-get install -y pandoc graphviz
# - name: Install EMMOntoPy
# run: |
# pip install --upgrade pip
# pip install EMMOntoPy
#
# - name: Generate documentation
# run: |
# cd doc
# ontodoc --template=chameo.md --format=html ../chameo.ttl chameo.html
#
# - name: Publish
# uses: peaceiris/actions-gh-pages@v4
# if: github.ref == 'refs/heads/main'
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./doc
# #keep_files: true
# #external_repository: emmo-repo.github.io/domain-characterisation-methodology/
# #publish_branch: main
# #force_orphan: true
#

0 comments on commit 543bd0a

Please sign in to comment.