Skip to content

Merge pull request #5110 from unisonweb/fix-merge-bug #1196

Merge pull request #5110 from unisonweb/fix-merge-bug

Merge pull request #5110 from unisonweb/fix-merge-bug #1196

Workflow file for this run

name: Haddocks
defaults:
run:
working-directory: unison
shell: bash
on:
push:
branches:
- trunk
jobs:
build:
name: Haddocks
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
path: unison
- name: restore stack caches
uses: unisonweb/actions/stack/cache/restore@main
with:
cache-prefix: haddocks
stack-yaml-dir: unison
- name: install stack
uses: unisonweb/actions/stack/install@main
- name: build with haddocks
working-directory: unison
run: stack build --fast --haddock
- name: save stack caches
uses: unisonweb/actions/stack/cache/save@main
with:
cache-prefix: haddocks
stack-yaml-dir: unison
# Haddocks
- name: Checkout haddocks branch
uses: actions/checkout@v4
with:
ref: haddocks
path: haddocks
# Needed for `git commit` below
- name: set git user info
working-directory: unison
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
- name: Copy haddocks
working-directory: unison
run: |
docs_root="$(stack path --local-doc-root)"
# Erase any stale files
cd "$GITHUB_WORKSPACE"/haddocks
rm -rf ./*
git checkout --orphan fresh-haddocks-branch
cp -r "${docs_root}"/* "$GITHUB_WORKSPACE"/haddocks
git add .
git commit -m "Regenerated haddocks based on ${GITHUB_SHA}"
# Push the branch with only a single commit over the remote
git push --force origin fresh-haddocks-branch:haddocks