-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build image with `podman` because it's rootless.
- Loading branch information
Pamplemousse
committed
Jan 12, 2025
1 parent
d769ddf
commit 2782af5
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
devShell = nixpkgs-pkgs.mkShell { | ||
buildInputs = with nixpkgs-pkgs; [ | ||
nodejs_20 | ||
podman | ||
]; | ||
}; | ||
} | ||
|