Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish Haddocks to firebase rather than github pages to save on repo size #4378

Draft
wants to merge 3 commits into
base: trunk
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 12 additions & 18 deletions .github/workflows/haddocks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
push:
branches:
- trunk
# TODO: remove
- cp/firebase-haddocks

jobs:
build:
Expand Down Expand Up @@ -76,25 +78,17 @@ jobs:
working-directory: unison
run: stack --no-terminal build --fast --haddock

# Haddocks
- name: Checkout haddocks branch
uses: actions/checkout@v2
with:
ref: 'haddocks'
path: 'haddocks'

- name: Copy haddocks
- name: Copy haddocks to firebase site
working-directory: 'unison'
run: |
docs_root="$(stack path --local-doc-root)"
# Erase any stale files
cd "$GITHUB_WORKSPACE"/haddocks
rm -rf ./*
cp -r "${docs_root}"/* "$GITHUB_WORKSPACE"/haddocks
if [[ -z "$(git status --porcelain)" ]]; then
echo No changes.
else
git add .
git commit -m "Regenerated haddocks based on ${GITHUB_SHA}"
git push
fi
rm -rf ./haddocks/public
cp -r "${docs_root}" ./haddocks/public

- uses: FirebaseExtended/action-hosting-deploy@v0
with:
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_UNISON_DOCS }}'
channelId: live
projectId: unison-docs
entryPoint: '${{ github.workspace }}/haddocks'
5 changes: 5 additions & 0 deletions haddocks/.firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "unison-docs"
}
}
3 changes: 3 additions & 0 deletions haddocks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This directory contains configuration for publishing unison haddocks to a firebase site.

See the `.github/workflows/haddocks.yaml` workflow for more details.
10 changes: 10 additions & 0 deletions haddocks/firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
}
}
Loading