summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorDan Zheng <danielzheng@google.com>2021-04-08 11:52:55 -0400
committerGitHub <noreply@github.com>2021-04-08 17:52:55 +0200
commita94638cbd4ab16b45bdf4fcf1fe921fc166658eb (patch)
tree23c87df76ce34666264649bf82bd94ecfcac4ebd /.github
parent868729570ac45e56ba8df1b2c6ebb7a62d2d711c (diff)
Automate HTML doc generation via GitHub Actions. (#491)
Add GitHub Actions workflow to run `make docs` and push to gh-pages branch upon pushes to main branch. This should greatly alleviate the need to manually update gh-pages branch.
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/ci.yaml6
-rw-r--r--.github/workflows/docs.yaml57
2 files changed, 60 insertions, 3 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index ca00fbee..69a8d21e 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -8,6 +8,7 @@ on:
jobs:
build:
+ runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, macos-latest]
@@ -19,8 +20,6 @@ jobs:
install_deps: sudo apt-get install llvm-9-tools llvm-9-dev pkg-config wget gzip
path_extension: /usr/lib/llvm-9/bin
- runs-on: ${{ matrix.os }}
-
steps:
- name: Checkout the repository
uses: actions/checkout@v2
@@ -56,7 +55,8 @@ jobs:
key: ${{ runner.os }}-${{ hashFiles('**/*.cabal', 'stack*.yaml') }}
restore-keys: ${{ runner.os }}-
- # See https://github.com/actions/cache/issues/445
+ # This step is a workaround.
+ # See issue for context: https://github.com/actions/cache/issues/445
- name: Remove cached Setup executables
run: rm -rf ~/.stack/setup-exe-cache
if: runner.os == 'macOS'
diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml
new file mode 100644
index 00000000..535deda2
--- /dev/null
+++ b/.github/workflows/docs.yaml
@@ -0,0 +1,57 @@
+name: Update HTML docs
+
+on:
+ push:
+ branches:
+ - main
+
+jobs:
+ build:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: [ubuntu-18.04]
+ include:
+ - os: ubuntu-18.04
+ install_deps: sudo apt-get install llvm-9-tools llvm-9-dev pkg-config
+ path_extension: /usr/lib/llvm-9/bin
+
+ steps:
+ - name: Checkout the repository
+ uses: actions/checkout@v2
+
+ - name: Setup Haskell Stack
+ uses: actions/setup-haskell@v1
+ with:
+ enable-stack: true
+ stack-no-global: true
+ stack-version: 'latest'
+
+ - name: Install system dependencies
+ run: |
+ ${{ matrix.install_deps }}
+ echo "${{ matrix.path_extension }}" >> $GITHUB_PATH
+
+ - name: Cache
+ uses: actions/cache@v2
+ with:
+ path: |
+ ~/.stack
+ $GITHUB_WORKSPACE/.stack-work
+ key: ${{ runner.os }}-${{ hashFiles('**/*.cabal', 'stack*.yaml') }}
+ restore-keys: ${{ runner.os }}-
+
+ - name: Build
+ run: make build
+
+ - name: Generate docs
+ run: make docs
+
+ - name: Deploy to GitHub Pages
+ uses: "JamesIves/github-pages-deploy-action@3dbacc7e69578703f91f077118b3475862cb09b8" # 4.1.0
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ branch: gh-pages # The branch the action should deploy to.
+ folder: doc # The folder the action should deploy.
+ clean: false # If true, automatically remove deleted files from the deploy branch.
+ commit-message: Updating gh-pages from ${{ github.sha }}