Skip to content

Instantly share code, notes, and snippets.

@ewpratten
Created August 23, 2020 19:59
Show Gist options
  • Save ewpratten/4a69af01250291eb2981510feddef642 to your computer and use it in GitHub Desktop.
Save ewpratten/4a69af01250291eb2981510feddef642 to your computer and use it in GitHub Desktop.
GitHub CI build scripts for school
#! /bin/bash
"${GITHUB_WORKSPACE}/bin/bazel" clean
"${GITHUB_WORKSPACE}/bin/bazel" build //:all
mkdir -p docs
cp -r -v bazel-bin/* ./docs/
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