Publish docker images with a woodpecker pipeline #22
2 changed files with 20 additions and 2 deletions
|
@ -17,9 +17,9 @@ steps:
|
||||||
- name: build
|
- name: build
|
||||||
image: nixpkgs/nix:nixos-22.05
|
image: nixpkgs/nix:nixos-22.05
|
||||||
commands:
|
commands:
|
||||||
- nix build --extra-experimental-features nix-command --extra-experimental-features flakes .#packages.x86_64-linux.debug
|
- nix build -j4 --extra-experimental-features nix-command --extra-experimental-features flakes .#packages.x86_64-linux.debug
|
||||||
|
|
||||||
- name: test
|
- name: test
|
||||||
image: nixpkgs/nix:nixos-22.05
|
image: nixpkgs/nix:nixos-22.05
|
||||||
commands:
|
commands:
|
||||||
- nix build --extra-experimental-features nix-command --extra-experimental-features flakes .#packages.x86_64-linux.test
|
- nix build -j4 --extra-experimental-features nix-command --extra-experimental-features flakes .#packages.x86_64-linux.test
|
||||||
|
|
18
.woodpecker/publish.yaml
Normal file
18
.woodpecker/publish.yaml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- deployment
|
||||||
|
- cron
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: docker build and publish
|
||||||
|
image: nixpkgs/nix:nixos-22.05
|
||||||
|
environment:
|
||||||
|
DOCKER_AUTH:
|
||||||
|
from_secret: docker_auth
|
||||||
|
commands:
|
||||||
|
- mkdir -p /root/.docker
|
||||||
|
- echo $DOCKER_AUTH > /root/.docker/config.json
|
||||||
|
- export CONTAINER_TAG=${CI_COMMIT_TAG:-$CI_COMMIT_SHA}
|
||||||
|
- nix-build -j4 --extra-experimental-features nix-command --extra-experimental-features flakes .#packages.x86_64-linux.docker
|
||||||
|
- nix-shell -p gzip --run "gunzip -c ./result > image.tar"
|
||||||
|
- nix-shell -p crane --run "crane push ./image.tar dxflrs/tricot:$CONTAINER_TAG"
|
Loading…
Add table
Reference in a new issue