2023-03-26 00:00:23 +01:00
|
|
|
pipeline:
|
2023-04-05 23:53:25 +02:00
|
|
|
build-stable:
|
2023-05-17 13:16:09 +02:00
|
|
|
image: code.cozy.town/vrifox/hugoci:latest
|
2023-03-26 00:00:23 +01:00
|
|
|
commands:
|
2023-03-30 09:57:53 +02:00
|
|
|
- hugo --destination /woodpecker/build/ --minify --cleanDestinationDir
|
2023-04-05 23:53:25 +02:00
|
|
|
when:
|
2023-05-17 17:57:02 +02:00
|
|
|
branch: main
|
2023-03-27 16:17:59 +02:00
|
|
|
|
2023-04-05 22:17:53 +02:00
|
|
|
upload-stable:
|
2023-05-17 13:16:09 +02:00
|
|
|
image: code.cozy.town/vrifox/hugoci:latest
|
2023-03-27 16:17:59 +02:00
|
|
|
commands:
|
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
|
2023-03-30 09:57:53 +02:00
|
|
|
- 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
|
2023-04-05 22:02:03 +02:00
|
|
|
- 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-05-17 17:57:02 +02:00
|
|
|
secrets:
|
|
|
|
- ssh_key
|
|
|
|
- ssh_port
|
|
|
|
- ssh_host
|
|
|
|
when:
|
|
|
|
branch: main
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build-dev:
|
|
|
|
image: code.cozy.town/vrifox/hugoci:latest
|
|
|
|
commands:
|
|
|
|
- hugo --destination /woodpecker/build/ --baseURL "https://dev.vrifox.cc/${CI_COMMIT_BRANCH}/${CI_COMMIT_SHA}/" --cleanDestinationDir
|
2023-03-30 09:57:53 +02:00
|
|
|
when:
|
2023-05-17 17:57:02 +02:00
|
|
|
branch:
|
|
|
|
exclude: main
|
2023-03-29 20:13:51 +02:00
|
|
|
|
2023-04-05 22:17:53 +02:00
|
|
|
upload-dev:
|
2023-05-17 13:16:09 +02:00
|
|
|
image: code.cozy.town/vrifox/hugoci:latest
|
2023-03-30 09:57:53 +02:00
|
|
|
commands:
|
|
|
|
- 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
|
2023-04-05 23:53:25 +02:00
|
|
|
- rsync -rv --delete -e "ssh -p $SSH_PORT -i /root/.ssh/id_ed25519" /woodpecker/build/ caddy@$SSH_HOST:/var/lib/caddy/woodpecker/vrifox.cc-dev/${CI_COMMIT_BRANCH}/${CI_COMMIT_SHA}/ --mkpath --checksum
|
|
|
|
- echo "The preview is now available on https://dev.vrifox.cc/${CI_COMMIT_BRANCH}/${CI_COMMIT_SHA}/"
|
2023-05-17 17:57:02 +02:00
|
|
|
secrets:
|
|
|
|
- ssh_key
|
|
|
|
- ssh_port
|
|
|
|
- ssh_host
|
2023-04-05 22:40:03 +02:00
|
|
|
when:
|
2023-04-05 22:17:53 +02:00
|
|
|
branch:
|
2023-05-17 17:57:02 +02:00
|
|
|
exclude: main
|