From 220ae2b78713e190188334bb3101098cef369299 Mon Sep 17 00:00:00 2001 From: Sokhibjon Orzikulov Date: Sun, 22 Dec 2024 07:04:55 +0500 Subject: [PATCH] chore: deploy nix builds --- .github/workflows/deploy.yml | 37 +++++++------------------------- .github/workflows/test.yml | 41 ++++++++++++------------------------ default.nix | 2 +- 3 files changed, 22 insertions(+), 58 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index af5d5d7..2001ff5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -28,37 +28,16 @@ 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 @@ -66,7 +45,7 @@ jobs: - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: - path: 'dist' + path: 'result/www' - name: Deploy to GitHub Pages id: deployment diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 78f7dd1..329ce5d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/default.nix b/default.nix index bb27cf2..d10bbc1 100644 --- a/default.nix +++ b/default.nix @@ -63,7 +63,7 @@ pkgs.rustPlatform.buildRustPackage { cargo build --release # Build wasm webiste - trunk build --release + trunk build --release --public-url=/ ''; installPhase = ''