Skip to content

Automate the creation of documentation versions #23

Automate the creation of documentation versions

Automate the creation of documentation versions #23

Workflow file for this run

name: Documentation
on:
push:
branches:
- main
pull_request:
jobs:
deploy:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
env:
upa_deploy: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, "refs/tags/v") || '' }}

Check failure on line 15 in .github/workflows/documentation.yml

View workflow run for this annotation

GitHub Actions / Documentation

Invalid workflow file

The workflow is not valid. .github/workflows/documentation.yml (Line: 15, Col: 19): Unexpected symbol: '"refs/tags/v"'. Located at position 59 within expression: github.ref == 'refs/heads/main' || startsWith(github.ref, "refs/tags/v") || ''
upa_docs_repository: upa-url/docs
# Used in Doxyfile: PROJECT_NUMBER = $(UPA_DOCS_VERSION)
UPA_DOCS_VERSION: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v4
- name: Download theme
run: doc/download-theme.sh
- uses: mattnotmitt/doxygen-action@edge
- name: Is there a gh-pages branch?
if: env.upa_deploy
run: echo "upa_checkout=$(git ls-remote --heads https://github.com/$upa_docs_repository.git refs/heads/gh-pages)" >> "$GITHUB_ENV"
- name: Checkout ${{ env.upa_docs_repository }}
uses: actions/checkout@v4
if: env.upa_deploy && env.upa_checkout
with:
repository: ${{ env.upa_docs_repository }}
ref: gh-pages
path: build-docs
- name: Update versions.txt
if: env.upa_deploy
run: |
mkdir -p build-docs
echo "upa_docs_dir=$(tools/update-docs-versions.py build-docs $GITHUB_REF)" >> "$GITHUB_ENV"
- name: Prepare directory for publication
if: env.upa_deploy && env.upa_docs_dir
run: |
sudo chown --recursive $USER doc/html
rm -rf build-docs/.git
rm -rf build-docs/common
rm -rf build-docs/${{ env.upa_docs_dir }}
cp -r doc/common build-docs/common
mv doc/html build-docs/${{ env.upa_docs_dir }}
cp doc/index.html build-docs
- name: Deploy to ${{ env.upa_docs_repository }}
uses: JamesIves/github-pages-deploy-action@v4
if: env.upa_deploy && env.upa_docs_dir
with:
ssh-key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
repository-name: ${{ env.upa_docs_repository }}
folder: build-docs