mirror of
https://github.com/sbrow/thor.git
synced 2026-10-25 10:11:55 -04:00
ci: Fixed build.
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
name: Deploy site to GitHub Pages
|
|
||||||
|
|
||||||
# Custom Pages build: compiles Thor from source via the Nix flake, uses it to
|
# Custom Pages build: compiles Thor from source via the Nix flake, uses it to
|
||||||
# generate thor/site/, and publishes the result. Replaces the default Jekyll build.
|
# generate thor/site/, and publishes the result. Replaces the default Jekyll build.
|
||||||
|
name: Deploy site to GitHub Pages
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -16,7 +15,6 @@ on:
|
|||||||
- ".github/workflows/pages.yml"
|
- ".github/workflows/pages.yml"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
# Least-privilege permissions required to deploy to GitHub Pages.
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
pages: write
|
pages: write
|
||||||
@@ -35,19 +33,33 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: DeterminateSystems/nix-installer-action@main
|
uses: cachix/install-nix-action@v30
|
||||||
|
with:
|
||||||
|
extra_nix_config: |
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
|
||||||
# Optional but recommended: caches the Nix store across runs so Thor
|
# Free cache: snapshots /nix/store into GitHub's Actions cache. The key is
|
||||||
# (and its tree-sitter grammars) aren't rebuilt from scratch every time.
|
# hashed over the inputs that change Thor's output, so a site-content-only
|
||||||
- name: Cache Nix store
|
# change is a full hit (Thor not recompiled), while an Odin source change
|
||||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
# restores the nearest store and rebuilds just the delta.
|
||||||
|
- name: Cache /nix/store
|
||||||
|
uses: nix-community/cache-nix-action@v6
|
||||||
|
with:
|
||||||
|
primary-key: nix-${{ runner.os }}-${{ hashFiles('flake.lock', '**/*.nix', '**/*.odin') }}
|
||||||
|
restore-prefixes-first-match: nix-${{ runner.os }}-
|
||||||
|
gc-max-store-size-linux: 2G
|
||||||
|
purge: true
|
||||||
|
purge-prefixes: nix-${{ runner.os }}-
|
||||||
|
purge-created: 604800 # drop entries older than 7 days
|
||||||
|
|
||||||
|
# First run compiles Thor + the tree-sitter grammar libs; later runs
|
||||||
|
# restore them from the cache above and skip the compile.
|
||||||
- name: Build Thor
|
- name: Build Thor
|
||||||
run: nix build .#default --print-build-logs
|
run: nix build .#default --print-build-logs
|
||||||
|
|
||||||
- name: Generate site
|
- name: Generate site
|
||||||
working-directory: site
|
working-directory: site
|
||||||
run: ../result/bin/thor --base-url "https://sbrow.github.io/thor" --minify
|
run: ../result/bin/thor -base-url=https://sbrow.github.io/thor -minify
|
||||||
|
|
||||||
- name: Upload Pages artifact
|
- name: Upload Pages artifact
|
||||||
uses: actions/upload-pages-artifact@v3
|
uses: actions/upload-pages-artifact@v3
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"base_url": "https://sbrow.github.io/thor",
|
|
||||||
"date": {
|
"date": {
|
||||||
"timezone": "America/New_York"
|
"timezone": "America/New_York"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user