Skip to content

Commit

Permalink
Manifest for builds.sr.ht
Browse files Browse the repository at this point in the history
Build image with `podman` because it's rootless.
  • Loading branch information
Pamplemousse committed Jan 12, 2025
1 parent d769ddf commit 2782af5
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .build.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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/)

Expand Down
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
devShell = nixpkgs-pkgs.mkShell {
buildInputs = with nixpkgs-pkgs; [
nodejs_20
podman
];
};
}
Expand Down

0 comments on commit 2782af5

Please sign in to comment.