-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a41d3b1
commit 6f4d627
Showing
4 changed files
with
131 additions
and
0 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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 @@ | ||
* @MakiseKurisu |
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,71 @@ | ||
name: Build projects | ||
on: | ||
pull_request: | ||
push: | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Why are we doing this? | ||
# | ||
# The hosted GitHub runners have free disk space split | ||
# between the root partition and a temporary partition, | ||
# leaving limited space for builds. We work around this | ||
# with easimon/maximize-build-space which creates a LVM | ||
# volume to combine the free space in both. | ||
# | ||
# We mount this new volume at /nix, and set TMPDIR so | ||
# all builds happen inside the volume. | ||
- name: Create mount point for Nix store | ||
run: | | ||
sudo mkdir /nix | ||
- name: Maximize disk space for builds | ||
uses: easimon/maximize-build-space@v10 | ||
with: | ||
build-mount-path: /nix | ||
|
||
- name: Set Nix store ownership | ||
run: | | ||
sudo chown root:root /nix | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Nix | ||
uses: DeterminateSystems/nix-installer-action@v13 | ||
|
||
- name: Override nix-daemon build directory | ||
run: | | ||
sudo mkdir -p /nix/tmp | ||
sudo chmod ug=rwx,o=rwxt /nix/tmp | ||
sudo mkdir -p /etc/systemd/system/nix-daemon.service.d | ||
sudo tee /etc/systemd/system/nix-daemon.service.d/override.conf >/dev/null <<EOF | ||
[Service] | ||
Environment=TMPDIR=/nix/tmp | ||
EOF | ||
sudo systemctl daemon-reload | ||
sudo systemctl restart nix-daemon | ||
- name: Setup automatic caching | ||
uses: DeterminateSystems/magic-nix-cache-action@v7 | ||
|
||
- name: Build known packages | ||
run: | | ||
for i in dewclaw-env dewclaw-book; do | ||
nix build ".#$i" | ||
mkdir -p "out/$i" | ||
output=$(readlink -f result) | ||
cp -vr --dereference "$output" "out/$i" | ||
done | ||
- name: Upload archive to Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: 'out' | ||
path: 'out' | ||
if-no-files-found: error |
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,58 @@ | ||
name: Deploy website | ||
|
||
on: | ||
# Runs on pushes targeting the default branch | ||
push: | ||
branches: | ||
- "main" | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "github-pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
site-artifact: | ||
name: Build site artifact | ||
uses: ./.github/workflows/build.yaml | ||
deploy: | ||
needs: site-artifact | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Get built site | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: 'out' | ||
path: 'out' | ||
|
||
# *sigh* https://github.com/actions/upload-pages-artifact#artifact-validation | ||
# They won't use the raw artifact zip | ||
- name: Repack archive | ||
run: | | ||
cd out/dewclaw-book | ||
tar cf ../pages.tar.gz . | ||
- name: Upload repacked archive to Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: 'github-pages' | ||
path: 'out/pages.tar.gz' | ||
if-no-files-found: error | ||
|
||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
/result | ||
/out |