-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created a Firebase website for hosting the static site, as emitted by `mdbook build`. Wired up GHA workflows to 1. deploy ephemeral URLs on PRs 2. deploy to prod on merge into main The prod URL is currently `https://uips.penumbra.zone`. Cobbled together a devshell via nix flake, same tooling as in other repos, e.g. the guide [0]. [0] https://github.com/penumbra-zone/guide
- Loading branch information
Showing
9 changed files
with
190 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use flake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"projects": { | ||
"default": "penumbra-uips" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This file was auto-generated by the Firebase CLI | ||
# https://github.com/firebase/firebase-tools | ||
|
||
name: Deploy to Firebase Hosting on merge | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build_and_deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: install nix | ||
uses: DeterminateSystems/nix-installer-action@main | ||
- name: load nix cache | ||
uses: DeterminateSystems/magic-nix-cache-action@main | ||
|
||
- name: build static docroot | ||
run: nix develop --command just build | ||
|
||
- uses: FirebaseExtended/action-hosting-deploy@v0 | ||
with: | ||
repoToken: ${{ secrets.GITHUB_TOKEN }} | ||
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_PENUMBRA_UIPS }} | ||
channelId: live | ||
projectId: penumbra-uips |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# This file was auto-generated by the Firebase CLI | ||
# https://github.com/firebase/firebase-tools | ||
|
||
name: Deploy to Firebase Hosting on PR | ||
on: pull_request | ||
permissions: | ||
checks: write | ||
contents: read | ||
pull-requests: write | ||
jobs: | ||
build_and_preview: | ||
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: install nix | ||
uses: DeterminateSystems/nix-installer-action@main | ||
- name: load nix cache | ||
uses: DeterminateSystems/magic-nix-cache-action@main | ||
|
||
- name: build static docroot | ||
run: nix develop --command just build | ||
|
||
- uses: FirebaseExtended/action-hosting-deploy@v0 | ||
with: | ||
repoToken: ${{ secrets.GITHUB_TOKEN }} | ||
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_PENUMBRA_UIPS }} | ||
projectId: penumbra-uips |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"hosting": { | ||
"public": "book", | ||
"ignore": [ | ||
"firebase.json", | ||
"**/.*", | ||
"**/node_modules/**" | ||
] | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# in flake.nix | ||
{ | ||
inputs = { | ||
# nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
outputs = { self, nixpkgs, flake-utils }: | ||
flake-utils.lib.eachDefaultSystem | ||
(system: | ||
let | ||
pkgs = import nixpkgs { | ||
inherit system ; | ||
}; | ||
in | ||
with pkgs; | ||
{ | ||
devShells.default = mkShell { | ||
buildInputs = [ | ||
firebase-tools | ||
just | ||
markdownlint-cli | ||
mdbook | ||
]; | ||
}; | ||
} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# display this help menu | ||
list: | ||
@just --list | ||
|
||
# build static site | ||
build: | ||
mdbook build | ||
|
||
# run code linters to check formatting | ||
lint: | ||
markdownlint --config .markdownlint.yaml '**/*.md' | ||
|
||
# run dev env with livereload, for local editing | ||
dev: | ||
mdbook serve -n 127.0.0.1 | ||
|
||
# run dev env via firebase, for a more prod-like local editing experience | ||
firebase-dev: | ||
@just build | ||
firebase emulators:start |