31 lines
692 B
YAML
31 lines
692 B
YAML
stages:
|
|
- build
|
|
- deploy
|
|
|
|
build:
|
|
stage: build
|
|
image: golang:bookworm
|
|
before_script:
|
|
- bash hack/install-xcaddy.sh
|
|
script:
|
|
- >
|
|
xcaddy
|
|
build
|
|
--output ./caddy
|
|
--with github.com/caddy-dns/cloudflare
|
|
artifacts:
|
|
paths:
|
|
- caddy
|
|
|
|
deploy:
|
|
stage: deploy
|
|
image: alpine/ansible:latest
|
|
before_script:
|
|
- "command -v ssh-agent >/dev/null || ( apk add --no-cache openssh-client )"
|
|
- eval $(ssh-agent -s)
|
|
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
|
|
- mkdir -p ~/.ssh
|
|
- chmod 700 ~/.ssh
|
|
- ssh-keyscan -H valhalla.vxm.cz >> ~/.ssh/known_hosts
|
|
script:
|
|
- ansible-playbook -i inventory.ini playbook.yml
|