Skip to content

Commit

Permalink
chore: deploy nix builds
Browse files Browse the repository at this point in the history
  • Loading branch information
orzklv committed Dec 22, 2024
1 parent eb7de2d commit 220ae2b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 58 deletions.
37 changes: 8 additions & 29 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,45 +28,24 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
override: true
profile: minimal

- name: Install Nodejs
uses: actions/setup-node@v4
with:
node-version: "20.x"

- name: Install trunk
uses: jetli/trunk-action@v0.1.0
with:
version: "latest"

- name: Install PNPM
run: npm install -g pnpm

- name: Install dependencies
run: pnpm install
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main

- name: Compile css files
run: pnpm run css
- name: Cache Nix store
uses: DeterminateSystems/magic-nix-cache-action@main

- name: Build
run: trunk build --release --public-url=/
- name: Build via Nix
run: nix build

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'dist'
path: 'result/www'

- name: Deploy to GitHub Pages
id: deployment
Expand Down
41 changes: 13 additions & 28 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,22 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
override: true
profile: minimal
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main

- name: Install Nodejs
uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: Cache Nix store
uses: DeterminateSystems/magic-nix-cache-action@main

- name: Install trunk
uses: jetli/trunk-action@v0.1.0
with:
version: "latest"
- name: Check for flake configurations
run: nix flake check --all-systems --show-trace

- name: Install PNPM
run: npm install -g pnpm
- name: Compile css
run: nix-shell --run "tailwindcss -i ./style/input.css -o ./style/output.css"

- name: Install dependencies
run: pnpm install
- name: Compile website
run: nix-shell --run "trunk build --release"

- name: Compile css files
run: pnpm run css

- name: Build
run: trunk build

- name: Run tests
run: cargo test --verbose
- name: Build via Nix
run: nix build
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pkgs.rustPlatform.buildRustPackage {
cargo build --release
# Build wasm webiste
trunk build --release
trunk build --release --public-url=/
'';

installPhase = ''
Expand Down

0 comments on commit 220ae2b

Please sign in to comment.