switch to actions for github pages
This commit is contained in:
parent
39b6b1956c
commit
efbd61958c
2 changed files with 56 additions and 9 deletions
47
.github/workflows/pages.yml
vendored
Normal file
47
.github/workflows/pages.yml
vendored
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
name: "pages"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: "pages"
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install Nix
|
||||||
|
uses: cachix/install-nix-action@v23
|
||||||
|
with:
|
||||||
|
extra_nix_config: |
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
- name: Setup Pages
|
||||||
|
id: pages
|
||||||
|
uses: actions/configure-pages@v3
|
||||||
|
- name: Build Pages
|
||||||
|
run: |
|
||||||
|
nix build .#pages
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-pages-artifact@v2
|
||||||
|
with:
|
||||||
|
path: ./result
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
environment:
|
||||||
|
name: github-pages
|
||||||
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
steps:
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
id: deployment
|
||||||
|
uses: actions/deploy-pages@v2
|
18
flake.nix
18
flake.nix
|
@ -69,8 +69,6 @@
|
||||||
./dev/effect.nix
|
./dev/effect.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
hercules-ci.github-pages.branch = "master";
|
|
||||||
|
|
||||||
perSystem = { config, pkgs, ... }:
|
perSystem = { config, pkgs, ... }:
|
||||||
let
|
let
|
||||||
defaultPlatform = pkgs.stdenv.hostPlatform.system == "x86_64-linux";
|
defaultPlatform = pkgs.stdenv.hostPlatform.system == "x86_64-linux";
|
||||||
|
@ -91,13 +89,15 @@
|
||||||
nixosTests-pict-rs = pkgs.nixosTests.pict-rs;
|
nixosTests-pict-rs = pkgs.nixosTests.pict-rs;
|
||||||
};
|
};
|
||||||
|
|
||||||
hercules-ci.github-pages.settings.contents = pkgs.runCommand "pages"
|
packages = pkgs.lib.optionalAttrs defaultPlatform {
|
||||||
{
|
pages = pkgs.runCommand "pages"
|
||||||
buildInputs = [ config.devShells.mkdocs.nativeBuildInputs ];
|
{
|
||||||
} ''
|
buildInputs = [ config.devShells.mkdocs.nativeBuildInputs ];
|
||||||
cd ${self}
|
} ''
|
||||||
mkdocs build --strict --site-dir $out
|
cd ${self}
|
||||||
'';
|
mkdocs build --strict --site-dir $out
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
flake.darwinConfigurations =
|
flake.darwinConfigurations =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue