README edits and site update #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: API documentation | |
on: | |
release: | |
types: [published] | |
push: | |
branches: | |
- main | |
paths: | |
- 'src/**' | |
- 'include/**' | |
- 'css/**' | |
- 'resources/**' | |
- 'Doxyfile' | |
- '*.md' | |
- '.github/workflows/dox.yml' | |
pull_request: | |
paths: | |
- 'src/**' | |
- 'include/**' | |
- 'css/**' | |
- 'resources/**' | |
- 'Doxyfile' | |
- '*.md' | |
- '.github/workflows/dox.yml' | |
jobs: | |
apidocs: | |
name: Generate API documentation | |
runs-on: ubuntu-latest | |
steps: | |
- name: install doxygen | |
run: sudo apt-get install doxygen | |
- name: Check out smax-postgres | |
uses: actions/checkout@v4 | |
- name: Generate docs | |
run: make local-dox | |
site-update: | |
name: Update github pages | |
needs: apidocs | |
if: github.repository_owner == 'Smithsonian' && (github.event_name == 'release' || contains(github.event.head_commit.message, 'site update')) | |
runs-on: ubuntu-latest | |
steps: | |
- name: install doxygen | |
run: sudo apt-get install doxygen | |
- name: Checkout smax-postgres | |
uses: actions/checkout@v4 | |
with: | |
repository: Smithsonian/smax-postgres | |
path: smax-postgres | |
- name: Check out xchange dependency | |
uses: actions/checkout@v4 | |
with: | |
repository: Smithsonian/xchange | |
path: xchange | |
- name: Check out RedisX dependency | |
uses: actions/checkout@v4 | |
with: | |
repository: Smithsonian/redisx | |
path: redisx | |
- name: Check out smax-clib dependency | |
uses: actions/checkout@v4 | |
with: | |
repository: Smithsonian/smax-clib | |
path: smax-clib | |
- name: Generate xchange docs | |
run: make -C xchange local-dox | |
- name: Generate RedisX docs | |
run: make -C redisx local-dox | |
- name: Generate smax-clib docs | |
run: make -C smax-clib local-dox | |
- name: Generate headless README for smax-postgres | |
run: make -C smax-postgres README-smax-postgres.md | |
- name: Generate smax-postgres apidocs | |
uses: mattnotmitt/[email protected] | |
with: | |
additional-packages: font-roboto | |
working-directory: ./smax-postgres | |
- name: Checkout gh-pages | |
uses: actions/checkout@v4 | |
with: | |
ref: 'gh-pages' | |
path: site | |
- name: Assert site/doc/ | |
run: mkdir -p site/doc | |
- name: Copy README | |
run: | | |
echo '<img src="/smax-postgres/resources/CfA-logo.png" alt="CfA logo" width="400" height="67" align="right">' > site/doc/README.md | |
echo '<br clear="all">' >> site/doc/README.md | |
cat smax-postgres/README-smax-postgres.md >> site/doc/README.md | |
- name: Copy CHANGELOG | |
run: cp smax-postgres/CHANGELOG.md site/doc/ | |
- name: Copy API documentation | |
run: cp -a smax-postgres/apidoc site/ | |
- name: Push to pages | |
run: | | |
cd site | |
git config --global user.email "$GITHUB_JOB+github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions" | |
git add -A | |
git commit -m "[automated site update]" && git push || true | |
changelog-update: | |
name: Update CHANGELOG on github pages | |
if: github.repository_owner == 'Smithsonian' && contains(github.event.head_commit.message, 'changelog update') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Checkout gh-pages | |
uses: actions/checkout@v4 | |
with: | |
ref: 'gh-pages' | |
path: site | |
- name: Assert site/doc/ | |
run: mkdir -p site/doc | |
- name: Copy CHANGELOG | |
run: cp CHANGELOG.md site/doc/ | |
- name: Push to pages | |
run: | | |
cd site | |
git config --global user.email "$GITHUB_JOB+github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions" | |
git add -A | |
git commit -m "[automated site update]" && git push || true | |