website/.woodpecker.yml

35 lines
1.2 KiB
YAML
Raw Normal View History

2023-03-26 00:00:23 +01:00
pipeline:
build:
2023-03-29 20:13:51 +02:00
image: archlinux
2023-03-26 00:00:23 +01:00
commands:
2023-03-29 22:08:09 +02:00
- pacman -Syu --noconfirm hugo git
- hugo --destination /woodpecker/build/ --minify --cleanDestinationDir
2023-03-27 16:17:59 +02:00
upload-main:
2023-03-29 20:13:51 +02:00
image: archlinux
2023-03-27 16:17:59 +02:00
commands:
2023-03-29 22:16:22 +02:00
- pacman -Syu --noconfirm openssh rsync
2023-03-29 22:08:09 +02:00
- mkdir -p /root/.ssh
2023-03-29 22:32:56 +02:00
- echo "$SSH_KEY" > /root/.ssh/id_ed25519
- chmod 700 /root/.ssh/id_ed25519
2023-03-29 22:08:09 +02:00
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config
- rsync -rv --delete -e "ssh -p $SSH_PORT -i /root/.ssh/id_ed25519" /woodpecker/build/ caddy@$SSH_HOST:/var/lib/caddy/woodpecker/vrifox.cc/ --mkpath --checksum
2023-03-29 22:16:22 +02:00
secrets: [ ssh_key, ssh_port, ssh_host ]
when:
branch: main
2023-03-29 20:13:51 +02:00
upload-cicd:
image: archlinux
commands:
- pacman -Syu --noconfirm openssh rsync
- mkdir -p /root/.ssh
- echo "$SSH_KEY" > /root/.ssh/id_ed25519
- chmod 700 /root/.ssh/id_ed25519
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config
- rsync -rv --delete -e "ssh -p $SSH_PORT -i /root/.ssh/id_ed25519" /woodpecker/build/ caddy@$SSH_HOST:/var/lib/caddy/woodpecker/vrifox.cc-cicd/ --mkpath --checksum
secrets: [ ssh_key, ssh_port, ssh_host ]
when:
branch: cicd
branches: [ main, cicd ]