liveterm/.woodpecker.yml

46 lines
1.1 KiB
YAML
Raw Normal View History

2023-02-11 04:34:11 +00:00
matrix:
RUST: [stable]
pipeline:
2023-02-11 18:19:29 +00:00
# test:
# image: rust
# environment: [CARGO_TERM_COLOR=always]
# commands:
# - rustup default $RUST
# - cargo check
# - cargo test
2023-02-11 17:34:35 +00:00
build-docker-image:
image: nixos/nix
commands:
- ls -la
- pwd
2023-02-11 18:14:57 +00:00
- nix --extra-experimental-features "nix-command flakes" build -o image.tar.gz .#liveterm-docker
2023-02-11 18:19:29 +00:00
- cp --remove-destination $(readlink -f image.tar.gz) /shared/image.tar.gz
2023-02-11 17:34:35 +00:00
volumes:
- "liveterm-shared:/shared"
when:
# event: tag
branch: master
2023-02-11 18:26:18 +00:00
push-container:
2023-02-11 17:56:34 +00:00
image: podman-image
2023-02-11 17:34:35 +00:00
commands:
- ls -la
- pwd
2023-02-11 18:14:57 +00:00
- podman load < /shared/image.tar.gz
2023-02-11 17:34:35 +00:00
- export REPO=git.mzhang.io/michael/liveterm
2023-02-11 18:14:57 +00:00
- export TAG=$(podman images liveterm --format "{{.Tag}}")
- podman tag liveterm:$TAG $REPO:$TAG
2023-02-11 18:26:18 +00:00
- podman tag liveterm:$TAG $REPO:latest
2023-02-11 18:14:57 +00:00
- podman login git.mzhang.io --username michael --password $DOCKER_TOKEN
- podman push $REPO:$TAG
2023-02-11 18:26:18 +00:00
- podman push $REPO:latest
2023-02-11 18:14:57 +00:00
secrets:
- DOCKER_TOKEN
2023-02-11 17:34:35 +00:00
volumes:
- "liveterm-shared:/shared"
when:
# event: tag
branch: master