Skip to content

Commit

Permalink
Merge pull request #138 from cubing/lgarron/ungulped-site
Browse files Browse the repository at this point in the history
Generate an updated site from the ungulped code.
  • Loading branch information
lgarron authored Jan 3, 2025
2 parents fca76be + e7b873b commit 6809f76
Show file tree
Hide file tree
Showing 12 changed files with 1,021 additions and 17 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: icons.cubing.net

on:
push:
branches: [main]

concurrency:
group: pages
cancel-in-progress: true

jobs:
build-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix build .#web --out-link ./dist/web/icons.cubing.net
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./dist/web/icons.cubing.net

deploy-pages:
runs-on: ubuntu-latest

needs: build-pages

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
# https://github.com/actions/deploy-pages#usage
permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ bun.lockb: package-lock.json
bun pm migrate --force

.PHONY: build
build: build-lib
build: build-lib build-web

.PHONY: build-lib
build-lib: setup
bun run script/build-lib.ts

.PHONY: build-web
build-web: setup
bun run script/build-web.ts

.PHONY: setup
setup: bun.lockb
ifndef NIX_BUILD_TOP
Expand All @@ -19,11 +23,11 @@ endif

.PHONY: lint
lint: setup
npx @biomejs/biome check
bun x @biomejs/biome check

.PHONY: format
format: setup
npx @biomejs/biome check --write"
bun x @biomejs/biome check --write

.PHONY: clean
clean:
Expand Down
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
flake-parts.lib.mkFlake { inherit inputs; } {
systems = import inputs.systems;
imports = [
./nix/formatting.nix
./nix/dev-shell.nix
./nix/www.nix
./nix/lint.nix
./nix/web.nix
];
};
}
2 changes: 1 addition & 1 deletion nix/dev-shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
devShells.default = pkgs.mkShell {
inputsFrom = [
self'.packages.www
self'.packages.web
];
};
};
Expand Down
File renamed without changes.
10 changes: 4 additions & 6 deletions nix/www.nix → nix/web.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
};
in
{
packages.www = pkgs.stdenvNoCC.mkDerivation {
name = "www";
packages.web = pkgs.stdenvNoCC.mkDerivation {
name = "web";
inherit src;

nativeBuildInputs = [
Expand All @@ -30,12 +30,10 @@
'';

installPhase = ''
# TODO: https://github.com/cubing/icons/pull/138
touch $out
# mv ./dist/web/icons.cubing.net $out
mv ./dist/web/icons.cubing.net $out
'';
};

checks.www = self'.packages.www;
checks.web = self'.packages.web;
};
}
Loading

0 comments on commit 6809f76

Please sign in to comment.