Skip to content

Update documentation about how to create a release (#6320) #44

Update documentation about how to create a release (#6320)

Update documentation about how to create a release (#6320) #44

Workflow file for this run

name: Deploy documentation
on:
push:
branches:
- 'r/*'
- 'develop'
concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy-documentation:
if: github.repository_owner == 'opencast'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: set up python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: install dependencies
working-directory: docs/guides/
run: |
pip install -q -r requirements.txt
- name: build admin docs
working-directory: docs/guides/admin/
run: |
python -m mkdocs build
- name: generate list of committers
working-directory: docs/guides/developer/
env:
GITHUB_USER: ${{ secrets.GH_USER }}
GITHUB_PA_TOKEN: ${{ secrets.GH_PA_TOKEN }}
run: |
./.generate-list-of-committers.sh
- name: build developer docs
working-directory: docs/guides/developer/
run: |
python -m mkdocs build
- name: build landing page
if: github.ref == 'refs/heads/develop'
working-directory: docs/guides/.infrastructure/
run: |
./generate-versions
- name: landing page dependencies
if: github.ref == 'refs/heads/develop'
working-directory: docs/guides/.infrastructure/
run: |
./prep-dependencies
- name: prepare git
run: |
git config --global user.name "Opencast Docs Bot"
git config --global user.email "cloud@opencast.org"
- name: prepare github ssh key
env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY_DOCS }}
run: |
install -dm 700 ~/.ssh/
echo "${DEPLOY_KEY}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan github.com >> ~/.ssh/known_hosts
- name: clone repository
run: |
git clone "git@github.com:opencast/docs.opencast.org.git" docs.opencast.org
cd docs.opencast.org
git checkout gh-pages
- name: remove old deployment
working-directory: docs.opencast.org/
run: |
set -x
echo "${GITHUB_REF#refs/heads/}"
if [ -d "${GITHUB_REF#refs/heads/}" ]; then
git rm -r "${GITHUB_REF#refs/heads/}"
fi
- name: remove old landing page dependencies
if: github.ref == 'refs/heads/develop'
working-directory: docs.opencast.org/
run: |
git rm -r js/ || true
- name: store landing page
if: github.ref == 'refs/heads/develop'
run: |
mv -v docs/guides/.infrastructure/*.html docs.opencast.org/
mv -v docs/guides/.infrastructure/*.js docs.opencast.org/
mv -v docs/guides/.infrastructure/js/ docs.opencast.org/
- name: store build
run: |
mkdir -p docs.opencast.org/"${GITHUB_REF#refs/heads/}"
mv -v docs/guides/admin/site docs.opencast.org/"${GITHUB_REF#refs/heads/}/admin"
mv -v docs/guides/developer/site docs.opencast.org/"${GITHUB_REF#refs/heads/}/developer"
git log -n1 > docs.opencast.org/"${GITHUB_REF#refs/heads/}/commit"
- name: commit new version
working-directory: docs.opencast.org/
run: |
git add .
git commit -m "Build of ${GITHUB_REF#refs/heads/} from $(date)"
- name: push updates
working-directory: docs.opencast.org/
run: |
set -e
if ! git push origin gh-pages; then
git fetch origin
git rebase origin/gh-pages
git push origin gh-pages
fi