Skip to content

Merge pull request #6 from dls-controls/fix_ci #43

Merge pull request #6 from dls-controls/fix_ci

Merge pull request #6 from dls-controls/fix_ci #43

name: Build and Docs CI
on:
push:
branches:
# Add more branches here to publish docs from other branches
- master
- main
tags:
- "*"
pull_request:
# Global environment
env:
# EPICS Base version for system block IOC
EPCISDBBUILER_VERSION: 1.5
jobs:
build:
name: "Build and Docs CI"
runs-on: ubuntu-latest
container: ghcr.io/epics-containers/epics-base-linux-developer:7.0.7ec3
steps:
- name: Checkout Source
uses: actions/checkout@v2
with:
# require history to get back to last tag for version number of branches
fetch-depth: 0
submodules: true
- name: Install Packages
# Pin Sphinx version to one that supports Python3, but does not feature an API
# change that would break our custom cdomain.py extension
# Pin Jinja2 and alabaster to fix dependency issue between them and sphinx
run: |
pip install epicsdbbuilder==${EPCISDBBUILER_VERSION} sphinx==2.3.1 Jinja2==3.0.3 alabaster==0.7.12
- name: Build (including docs)
run: |
echo "EPICS_BASE=${EPICS_BASE}" > configure/RELEASE
echo "EPICS_BASE=${EPICS_BASE}" >> examples/basic_ioc/configure/RELEASE
echo "EPICS_BASE=${EPICS_BASE}" >> examples/example_ioc/configure/RELEASE
echo "SPHINXBUILD=sphinx-build" >> configure/CONFIG_SITE
make
- name: Build Examples
run: |
make -C examples/example_ioc/
make -C examples/basic_ioc/
- name: Move Docs to versioned directory
# e.g. master or 0.1.2
run: mv docs/html ".github/pages/${GITHUB_REF##*/}"
- name: Publish Docs to gh-pages
# Only master and tags are published
if: "${{ github.repository_owner == 'dls-controls' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')) }}"
# We pin to the SHA, not the tag, for security reasons.
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .github/pages
keep_files: true