switch to actions for github pages

This commit is contained in:
zowoq 2023-09-15 11:17:28 +10:00
parent 39b6b1956c
commit efbd61958c
2 changed files with 56 additions and 9 deletions
.github/workflows
flake.nix

47
.github/workflows/pages.yml vendored Normal file
View 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

View file

@ -69,8 +69,6 @@
./dev/effect.nix
];
hercules-ci.github-pages.branch = "master";
perSystem = { config, pkgs, ... }:
let
defaultPlatform = pkgs.stdenv.hostPlatform.system == "x86_64-linux";
@ -91,13 +89,15 @@
nixosTests-pict-rs = pkgs.nixosTests.pict-rs;
};
hercules-ci.github-pages.settings.contents = pkgs.runCommand "pages"
{
buildInputs = [ config.devShells.mkdocs.nativeBuildInputs ];
} ''
cd ${self}
mkdocs build --strict --site-dir $out
'';
packages = pkgs.lib.optionalAttrs defaultPlatform {
pages = pkgs.runCommand "pages"
{
buildInputs = [ config.devShells.mkdocs.nativeBuildInputs ];
} ''
cd ${self}
mkdocs build --strict --site-dir $out
'';
};
};
flake.darwinConfigurations =