Arc-Lang: Version 1 #572
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: GitHub pages | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
env: | |
ZOLA_VERSION: 0.16.1 | |
MDBOOK_LINKCHECK_VERSION: 0.7.6 | |
MDBOOK_BIB_VERSION: 0.0.4 | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Update apt index | |
run: sudo apt-get update | |
# ---- cargo ---- | |
- name: Install Cargo nightly | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
- name: Cache arc-preprocessor | |
id: cache-arc-preprocessor | |
uses: actions/cache@v3 | |
with: | |
path: arc-docs/arc-preprocessor/target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('arc-docs/arc-preprocessor/**') }} | |
- name: Cache mdbook-bib | |
id: cache-mdbook-bib | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo/bin/mdbook-bib | |
key: ${{ runner.os }}-cargo-${{ env.MDBOOK_BIB_VERSION }} | |
- name: Cache mdbook-linkcheck | |
id: cache-mdbook-linkcheck | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo/bin/mdbook-linkcheck | |
key: ${{ runner.os }}-cargo-${{ env.MDBOOK_LINKCHECK_VERSION }} | |
- name: Cache zola | |
id: cache-zola | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo/bin/zola | |
key: ${{ runner.os }}-cargo-${{ env.ZOLA_VERSION }} | |
- name: Build arc-preprocessor | |
if: steps.cache-arc-preprocessor.outputs.cache-hit != 'true' | |
run: cargo build --manifest-path arc-docs/arc-preprocessor/Cargo.toml | |
- name: Build mdbook-bib | |
if: steps.cache-mdbook-bib.outputs.cache-hit != 'true' | |
run: cargo install mdbook-bib --version=${{ env.MDBOOK_BIB_VERSION }} --features="log/max_level_warn" | |
- name: Build mdbook-linkcheck | |
if: steps.cache-mdbook-linkcheck.outputs.cache-hit != 'true' | |
run: cargo install mdbook-linkcheck --version=${{ env.MDBOOK_LINKCHECK_VERSION }} | |
- name: Build zola | |
if: steps.cache-zola.outputs.cache-hit != 'true' | |
run: | | |
git clone https://github.com/getzola/zola.git | |
git -C zola checkout ad6c83412391dd748d4a9d8f3a0568687e73a447 | |
cargo install --path=zola --version=${{ env.ZOLA_VERSION }} zola | |
# ---- arc-report ---- | |
- name: Install LaTeX dependencies | |
run: sudo apt-get install texlive-xetex latexmk texlive-bibtex-extra biber | |
- name: Build arc-report | |
run: make -C arc-report | |
# ---- arc-docs ---- | |
- name: Setup mdbook | |
uses: peaceiris/actions-mdbook@v1 | |
with: | |
mdbook-version: '0.4.15' | |
- name: Build arc-docs | |
run: | |
mdbook build arc-lang/crates/docs | |
# ---- arc-website ---- | |
- name: Move artifacts to arc-website | |
run: | | |
mkdir arc-website/static | |
mv arc-report/target/main.pdf arc-website/static/Arc-Report.pdf | |
mv arc-docs/target/html arc-website/static/docs | |
- name: Update arc-website theme submodule | |
run: | | |
git submodule update --init arc-website/themes/adidoks | |
mkdir -p arc-website/templates | |
cp arc-website/themes/adidoks/templates/blog/page.html \ | |
arc-website/templates/blog.html | |
- name: Build arc-website | |
run: make -C arc-website build | |
- name: Deploy to gh-pages | |
uses: peaceiris/actions-gh-pages@v3 | |
if: | | |
success() && | |
github.event_name == 'push' && | |
github.ref == 'refs/heads/master' | |
with: | |
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
publish_dir: arc-website/target | |
force_orphan: true |