-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI that builds and deploys the spec to Pages
- Loading branch information
Showing
2 changed files
with
95 additions
and
0 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,83 @@ | ||
name: Build CGGMP21 Spec & Docs | ||
|
||
on: | ||
pull_request: | ||
branches: [ "*" ] | ||
paths: | ||
- 'cggmp21/**' | ||
- 'spec/**' | ||
- '.github/workflows/docs.yml' | ||
push: | ||
branches: [ "m" ] | ||
|
||
jobs: | ||
build_pdf: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Compile LaTeX document | ||
uses: xu-cheng/latex-action@v3 | ||
with: | ||
root_file: main.tex | ||
working_directory: spec | ||
- name: Rename PDF | ||
run: mv spec/main.pdf spec/cggmp21-spec.pdf | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: spec-pdf | ||
path: spec/cggmp21-spec.pdf | ||
- name: Leave PR comment | ||
continue-on-error: true | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
header: spec_is_built | ||
message: The spec was successfully compiled. PDF is available in the artifacts. | ||
build_docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: "true" | ||
- name: Build docs | ||
run: make docs && cp docs/redirect.html target/doc/index.html | ||
- name: Upload docs | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: docs | ||
path: target/doc | ||
deploy_pages: | ||
runs-on: ubuntu-latest | ||
needs: [build_pdf, build_docs] | ||
# if: github.ref == 'refs/heads/m' | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
permissions: | ||
pages: write | ||
id-token: write | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: docs | ||
path: website | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: spec-pdf | ||
path: website/cggmp21-spec.pdf | ||
- name: Prepare Github Pages deployment | ||
run: | | ||
mkdir public | ||
cp README.md public/index.md | ||
cp cggmp21-specs.pdf public | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: 'website' | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
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,12 @@ | ||
<!-- This file is meant to be an entry point of Github Pages --> | ||
|
||
<head> | ||
<meta http-equiv="Refresh" content="0; URL=cggmp21/index.html" /> | ||
<title>Redirection</title> | ||
</head> | ||
|
||
<body> | ||
<p> | ||
You are being redirected to another page. Click <a href="cggmp21/index.html">here</a> if it didn't work. | ||
</p> | ||
</body> |