Skip to content

Commit

Permalink
add document build and preview actions
Browse files Browse the repository at this point in the history
  • Loading branch information
pdowler committed Aug 30, 2024
1 parent 76b53a4 commit fee3cca
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 2 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This file generated from a template file maintained in the ivoatex repository.
# To create and install it into a project repository, do:
# make github-preview
# git commit
# git push
#
name: Check the IVOA document

env:
doc_name: CAOM

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
build:

runs-on: ubuntu-latest

steps:

- name: Checkout the repository
uses: actions/checkout@v1
with:
submodules: true

- name: Setup dependencies
run: |
sudo apt update
sudo apt install texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended xsltproc latexmk cm-super
- name: Build the document
run: make

- name: Check the output
run: |
test -f ${{ env.doc_name }}.pdf
test -f ${{ env.doc_name }}.bbl
- name: Keep the PDF artefact
uses: actions/upload-artifact@v1
with:
name: PDF Preview
path: ${{ env.doc_name }}.pdf
66 changes: 66 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# This file generated from a template file maintained in the ivoatex repository.
# To create and install it into a project repository, do:
# make github-preview
# git commit
# git push
#
name: Update PDF Preview

env:
doc_name: CAOM

on:
push:
branches:
- master

jobs:
build:

runs-on: ubuntu-latest

steps:

- name: Checkout the repository
uses: actions/checkout@v1
with:
submodules: true

- name: Setup dependencies
run: |
sudo apt update
sudo apt install texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended xsltproc latexmk cm-super
sudo snap install pdftk
- name: Build the document
run: make ${{ env.doc_name }}-draft.pdf

- name: Check the output
run: |
test -f ${{ env.doc_name }}-draft.pdf
test -f ${{ env.doc_name }}.bbl
- name: Move the auto-pdf-preview tag
uses: weareyipyip/walking-tag-action@v2
with:
tag-name: auto-pdf-preview
tag-message: |
Last commit taken into account for the automatically updated PDF preview of this IVOA document.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update the PDF preview
uses: Xotl/cool-github-releases@v1
with:
mode: update
isPrerelease: true
tag_name: auto-pdf-preview
release_name: "Auto PDF Preview"
body_mrkdwn: |
This release aims to provide a PDF preview of the last commit applied on this repository.
It will be updated automatically after each merge of a PullRequest.
**DO NOT PUBLISH THIS PRE-RELEASE!**"
_Corresponding commit: ${{ github.sha }}_
assets: ${{ env.doc_name }}-draft.pdf
replace_assets: true
github_token: ${{ secrets.GITHUB_TOKEN }}
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ This module contains a <a href="http://www.ivoa.net/documents/VODML/index.html">
description of the CAOM data model and test code to validate the model using the
<a href="https://github.com/opencadc/core/tree/master/cadc-vodml">cadc-vodml</a> tools.

The currently released documentation generated from this description:

The current released version is CAOM-2.4:
<a href="http://www.opencadc.org/caom2/">http://www.opencadc.org/caom2/</a>

The draft version is CAOM-2.5:
[![PDF-Preview](https://img.shields.io/badge/Preview-PDF-blue)](../../releases/download/auto-pdf-preview/CAOM-draft.pdf)


<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">
<img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a>
<br />The Common Archive Observation Model is licensed under the
Expand Down

0 comments on commit fee3cca

Please sign in to comment.