-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
74 additions
and
43 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Build LaTeX document and Coq-Doc | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
build-pdf: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
image: | ||
- 'mathcomp/mathcomp:1.12.0-coq-8.13' | ||
fail-fast: false | ||
steps: | ||
- name: Set up Git repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Compile Coq-Doc | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | ||
uses: coq-community/docker-coq-action@v1 | ||
with: | ||
custom_image: ${{ matrix.image }} | ||
before_script: | | ||
startGroup "Create Makefile.coq and add permission" | ||
make || true | ||
sudo chown -R coq:coq . | ||
endGroup | ||
script: | | ||
startGroup "Build documentation" | ||
make -j2 html | ||
endGroup | ||
uninstall: | | ||
startGroup "Clean" | ||
make clean | ||
endGroup | ||
- name: Revert Coq user permissions | ||
# to avoid a warning at cleanup time | ||
if: ${{ always() }} | ||
run: sudo chown -R 1001:116 . | ||
|
||
- name: Compile LaTeX document | ||
uses: xu-cheng/latex-action@v2 | ||
with: | ||
root_file: hydras.tex | ||
working_directory: doc | ||
latexmk_use_lualatex: true | ||
|
||
- name: Extract PDF and Coq-Doc | ||
run: | | ||
mkdir -p public/doc public/theories | ||
cp doc/hydras.pdf public/doc/ | ||
cp -r theories/html public/theories/ || true | ||
# Depending on whether we are on master or not, we deploy to | ||
# GitHub Pages or as an artifact | ||
- name: Deploy to GitHub pages | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | ||
uses: crazy-max/ghaction-github-pages@v2 | ||
with: | ||
build_dir: public | ||
jekyll: false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Deploy artifact | ||
if: github.event_name == 'pull_request' || github.ref != 'refs/heads/master' | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
path: public |
This file was deleted.
Oops, something went wrong.
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