Created
August 23, 2020 19:59
-
-
Save ewpratten/4a69af01250291eb2981510feddef642 to your computer and use it in GitHub Desktop.
GitHub CI build scripts for school
This file contains hidden or 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
#! /bin/bash | |
"${GITHUB_WORKSPACE}/bin/bazel" clean | |
"${GITHUB_WORKSPACE}/bin/bazel" build //:all | |
mkdir -p docs | |
cp -r -v bazel-bin/* ./docs/ |
This file contains hidden or 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: Deploy docs | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Mount bazel cache | |
uses: actions/cache@v1 | |
with: | |
path: "/home/runner/.cache/bazel" | |
key: bazel | |
- name: Install bazelisk | |
run: | | |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.1.0/bazelisk-linux-amd64" | |
mkdir -p "${GITHUB_WORKSPACE}/bin/" | |
mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel" | |
chmod +x "${GITHUB_WORKSPACE}/bin/bazel" | |
- name: Install pandoc | |
run: | | |
sudo apt install pandoc pandoc-citeproc texlive-latex-base texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra tree texlive-bibtex-extra biber -y | |
- name: Build | |
run: | | |
sh ci.sh | |
- name: Check GitHub Pages status | |
uses: crazy-max/ghaction-github-status@v1 | |
with: | |
pages_threshold: major_outage | |
- name: Deploy to GitHub Pages | |
if: success() | |
uses: crazy-max/ghaction-github-pages@v2 | |
with: | |
target_branch: gh-pages | |
build_dir: docs | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment