From 091fb16c538ad692181d69a9e002ac024e0ca467 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 8 Nov 2023 16:11:29 -0800 Subject: [PATCH] Add basic firebase site config --- .github/workflows/haddocks.yaml | 30 +++++------ haddocks/.firebaserc | 5 ++ haddocks/README.md | 3 ++ haddocks/firebase.json | 10 ++++ haddocks/public/404.html | 33 ++++++++++++ haddocks/public/index.html | 89 +++++++++++++++++++++++++++++++++ 6 files changed, 152 insertions(+), 18 deletions(-) create mode 100644 haddocks/.firebaserc create mode 100644 haddocks/README.md create mode 100644 haddocks/firebase.json create mode 100644 haddocks/public/404.html create mode 100644 haddocks/public/index.html diff --git a/.github/workflows/haddocks.yaml b/.github/workflows/haddocks.yaml index 923283c82a..ee402f1b1a 100644 --- a/.github/workflows/haddocks.yaml +++ b/.github/workflows/haddocks.yaml @@ -9,6 +9,8 @@ on: push: branches: - trunk + # TODO: remove + - cp/firebase-haddocks jobs: build: @@ -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: haddocks diff --git a/haddocks/.firebaserc b/haddocks/.firebaserc new file mode 100644 index 0000000000..372bb16f58 --- /dev/null +++ b/haddocks/.firebaserc @@ -0,0 +1,5 @@ +{ + "projects": { + "default": "unison-docs" + } +} diff --git a/haddocks/README.md b/haddocks/README.md new file mode 100644 index 0000000000..47a1a91029 --- /dev/null +++ b/haddocks/README.md @@ -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. diff --git a/haddocks/firebase.json b/haddocks/firebase.json new file mode 100644 index 0000000000..e782939234 --- /dev/null +++ b/haddocks/firebase.json @@ -0,0 +1,10 @@ +{ + "hosting": { + "public": "public", + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ] + } +} diff --git a/haddocks/public/404.html b/haddocks/public/404.html new file mode 100644 index 0000000000..829eda8fdc --- /dev/null +++ b/haddocks/public/404.html @@ -0,0 +1,33 @@ + + + + + + Page Not Found + + + + +
+

404

+

Page Not Found

+

The specified file was not found on this website. Please check the URL for mistakes and try again.

+

Why am I seeing this?

+

This page was generated by the Firebase Command-Line Interface. To modify it, edit the 404.html file in your project's configured public directory.

+
+ + diff --git a/haddocks/public/index.html b/haddocks/public/index.html new file mode 100644 index 0000000000..bc172edece --- /dev/null +++ b/haddocks/public/index.html @@ -0,0 +1,89 @@ + + + + + + Welcome to Firebase Hosting + + + + + + + + + + + + + + + + + + + +
+

Welcome

+

Firebase Hosting Setup Complete

+

You're seeing this because you've successfully setup Firebase Hosting. Now it's time to go build something extraordinary!

+ Open Hosting Documentation +
+

Firebase SDK Loading…

+ + + +