This commit is contained in:
parent
0169e430c3
commit
62b7cf9324
1 changed files with 33 additions and 27 deletions
|
@ -3,45 +3,51 @@ steps:
|
||||||
image: code.cozy.town/vrifox/hugoci:latest
|
image: code.cozy.town/vrifox/hugoci:latest
|
||||||
commands:
|
commands:
|
||||||
- hugo --destination /woodpecker/build/ --minify --cleanDestinationDir
|
- hugo --destination /woodpecker/build/ --minify --cleanDestinationDir
|
||||||
|
volumes:
|
||||||
|
- /srv/woodpecker-cache/vrifox.cc:/woodpecker/src/code.cozy.town/vrifox/website/resources/_gen
|
||||||
when:
|
when:
|
||||||
branch: main
|
- branch: main
|
||||||
|
event: [push, pull_request_closed, manual]
|
||||||
|
|
||||||
|
build-dev:
|
||||||
|
image: code.cozy.town/vrifox/hugoci:latest
|
||||||
|
commands:
|
||||||
|
- hugo --destination /woodpecker/build/ --baseURL "https://dev.vrifox.cc/" --cleanDestinationDir
|
||||||
|
volumes:
|
||||||
|
- /srv/woodpecker-cache/vrifox.cc:/woodpecker/src/code.cozy.town/vrifox.cc/website/resources/_gen
|
||||||
|
when:
|
||||||
|
- branch:
|
||||||
|
exclude: main
|
||||||
|
event: [push, pull_request, manual]
|
||||||
|
|
||||||
upload-stable:
|
upload-stable:
|
||||||
image: code.cozy.town/vrifox/hugoci:latest
|
image: code.cozy.town/vrifox/hugoci:latest
|
||||||
commands:
|
commands:
|
||||||
- mkdir -p /root/.ssh
|
- mkdir -p /root/.ssh
|
||||||
- echo "$SSH_KEY" > /root/.ssh/id_ed25519
|
- echo "$${DEPLOY_BOT_SSH_KEY}" > /root/.ssh/id_ed25519
|
||||||
- chmod 700 /root/.ssh/id_ed25519
|
- chmod 400 /root/.ssh/id_ed25519
|
||||||
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config
|
- 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
|
- rsync -rv --delete -e "ssh -p 42824 -i /root/.ssh/id_ed25519" /woodpecker/build/ deploy-bot@$cozytown-main.cozy.town:/srv/http/vrifox.cc/ --mkpath --checksum
|
||||||
secrets:
|
environment:
|
||||||
- ssh_key
|
DEPLOY_BOT_SSH_KEY:
|
||||||
- ssh_port
|
from_secret: deploy_bot_ssh_key
|
||||||
- ssh_host
|
|
||||||
when:
|
when:
|
||||||
branch: main
|
- branch: main
|
||||||
|
event: [push, pull_request_closed, manual]
|
||||||
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
|
|
||||||
when:
|
|
||||||
branch:
|
|
||||||
exclude: main
|
|
||||||
|
|
||||||
upload-dev:
|
upload-dev:
|
||||||
image: code.cozy.town/vrifox/hugoci:latest
|
image: code.cozy.town/vrifox/hugoci:latest
|
||||||
commands:
|
commands:
|
||||||
- mkdir -p /root/.ssh
|
- mkdir -p /root/.ssh
|
||||||
- echo "$SSH_KEY" > /root/.ssh/id_ed25519
|
- echo "$${DEPLOY_BOT_SSH_KEY}" > /root/.ssh/id_ed25519
|
||||||
- chmod 700 /root/.ssh/id_ed25519
|
- chmod 400 /root/.ssh/id_ed25519
|
||||||
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config
|
- 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-dev/${CI_COMMIT_BRANCH}/${CI_COMMIT_SHA}/ --mkpath --checksum
|
- rsync -rv --delete -e "ssh -p 42824 -i /root/.ssh/id_ed25519" /woodpecker/build/ deploy-bot@cozytown-main.cozy.town:/srv/http/vrifox.cc-dev/ --mkpath --checksum
|
||||||
- echo "The preview is now available on https://dev.vrifox.cc/${CI_COMMIT_BRANCH}/${CI_COMMIT_SHA}/"
|
- echo "The preview is now available on https://dev.vrifox.cc/"
|
||||||
secrets:
|
environment:
|
||||||
- ssh_key
|
DEPLOY_BOT_SSH_KEY:
|
||||||
- ssh_port
|
from_secret: deploy_bot_ssh_key
|
||||||
- ssh_host
|
|
||||||
when:
|
when:
|
||||||
branch:
|
- branch:
|
||||||
exclude: main
|
exclude: main
|
||||||
|
event: [push, pull_request, manual]
|
||||||
|
|
Loading…
Add table
Reference in a new issue