Skip to content

Commit

Permalink
package: frontend init at 0.1.0 (#52)
Browse files Browse the repository at this point in the history
* frontend: package webui as npmPackage

* webui: add github pages workflow

* webui: add remote flake support

* webui: dynamic flake
  • Loading branch information
jhvst authored Oct 11, 2024
1 parent 3d6bd77 commit efffbd2
Show file tree
Hide file tree
Showing 10 changed files with 6,461 additions and 7,713 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy to Pages

# Runs on pushes targeting things that look like the default branch
on:
push:
branches: ["main", "master"]
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

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

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Nix
uses: nixbuild/nix-quick-install-action@v28
with: {load_nixConfig: false}
- name: Build site
run: nix build .#frontend --print-build-logs
- name: Adjust permissions
run: |
chown -R `id -u`:`id -g` ./result
chmod -R a+rwx ./result
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./result
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"teku" = inputs.ethereum-nix.packages.${system}.teku;
# Main
"backend" = pkgs.callPackage ./packages/backend { };
"frontend" = pkgs.callPackage ./webui { };
"default" = packages.backend;
};
in
Expand Down
25 changes: 25 additions & 0 deletions webui/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{ buildNpmPackage
, nodejs
, ...
}:
buildNpmPackage {
name = "HomestakerOS-frontend";
version = "0.1.0";

# The packages required by the build process
buildInputs = [
nodejs
];

# The code sources for the package
src = ./.;
npmDepsHash = "sha256-fvSXDXYj/HF73QAu10AhNVJogBp4l5RTW1fjZ37mWKQ";

npmBuild = "npm run build";

# How the output of the build phase
installPhase = ''
mkdir $out
cp -r dist/* $out
'';
}
Loading

0 comments on commit efffbd2

Please sign in to comment.