Skip to content

Commit

Permalink
Add deploytask for gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
PicoCentauri committed Oct 17, 2023
1 parent 66b8ea2 commit 97c4df5
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 46 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Documentation

on:
push:
branches: [main]
tags: ["*"]
pull_request:
# Check all PR

jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: setup rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: install dependencies
run: |
python -m pip install tox
- name: build documentation
run: tox -e docs

- name: put documentation in the website
run: |
git clone https://github.com/$GITHUB_REPOSITORY --branch gh-pages gh-pages
rm -rf gh-pages/.git
cd gh-pages
REF_KIND=$(echo $GITHUB_REF | cut -d / -f2)
if [[ "$REF_KIND" == "tags" ]]; then
TAG=${GITHUB_REF#refs/tags/}
mv ../docs/build/html $TAG
else
rm -rf latest
mv ../docs/build/html latest
fi
- name: deploy to gh-pages
if: github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./gh-pages/
force_orphan: true

- if: github.event_name == 'pull_request'
name: Post link to RTD
uses: readthedocs/actions/preview@v1
with:
project-slug: "software-cookbook"
17 changes: 0 additions & 17 deletions .github/workflows/documentation-preview.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .readthedocs.yml

This file was deleted.

3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
COSMO Software Cookbook
=======================

`COSMO Software Cookbook <https://software-cookbook.rtfd.io/>`_
The source code for the COSMO cookbook maintained as a GitHub pages site. The home page
is accessible at https://lab-cosmo.github.io/software-cookbook/latest.

.. marker-intro-start
Expand Down

0 comments on commit 97c4df5

Please sign in to comment.