diff --git a/.build.yml b/.build.yml new file mode 100644 index 0000000..bad1a9a --- /dev/null +++ b/.build.yml @@ -0,0 +1,41 @@ +image: nixos/unstable +sources: + - https://git.sr.ht/~pamplemousse/xaviermaso.com +environment: + NIX_CONFIG: "experimental-features = nix-command flakes" +secrets: + - ffce471b-c586-4d54-a9cc-bc729b3bff11 +tasks: + - install: | + cd xaviermaso.com + nix develop --command bash -c \ + "npm install" + + - check: | + cd xaviermaso.com + nix develop --command bash -c \ + "npm run check" + + - build: | + cd xaviermaso.com + nix develop --command bash -c \ + "npm run build && \ + podman image build . -t pamplemousse/xaviermaso.com:latest" + + - push: + set +x + nix develop --command bash -c \ + 'podman login --username pamplemousse --password "$(cat ~/.dockerhub_password)"' + set -x + + image="docker://docker.io/pamplemousse/xaviermaso.com" + nix develop --command bash -c \ + 'podman push "$image:latest"' + + head="$(git rev-parse HEAD)" + matching_refs="$(git show-ref | grep "$head" | grep "refs/tags/")" + if [[ "$matching_refs" != "" ]]; then + tag="$(echo $matching_refs | cut -d'/' -f3)" + nix develop --command bash -c \ + 'podman push "$image:$tag"' + fi diff --git a/README.md b/README.md index 60e00b6..f2527f6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # xavier maso's website +[!["builds.sr.ht status"](https://builds.sr.ht/~pamplemousse/xaviermaso.com.svg)](https://builds.sr.ht/~pamplemousse/xaviermaso.com) + * powered by [expressjs](http://expressjs.com/) and [elm](http://elm-lang.org/) * running live at [xaviermaso.com](https://www.xaviermaso.com/) diff --git a/flake.nix b/flake.nix index df1bb4d..cb9560e 100644 --- a/flake.nix +++ b/flake.nix @@ -16,6 +16,7 @@ devShell = nixpkgs-pkgs.mkShell { buildInputs = with nixpkgs-pkgs; [ nodejs_20 + podman ]; }; }