2023-02-04 07:04:29 +00:00
|
|
|
pipeline:
|
|
|
|
build:
|
2023-10-11 21:17:08 +00:00
|
|
|
image: git.mzhang.io/michael/blog-builder:2.6.4-x86_64
|
2023-02-04 07:04:29 +00:00
|
|
|
commands:
|
2023-10-11 22:42:41 +00:00
|
|
|
- cd /tmp
|
2023-10-11 22:43:51 +00:00
|
|
|
- rm -rf astro
|
2023-10-11 22:42:41 +00:00
|
|
|
- git clone https://git.mzhang.io/michael/astro --depth 1
|
|
|
|
- cd astro
|
2023-10-11 22:27:24 +00:00
|
|
|
- pnpm install
|
2023-10-11 22:42:41 +00:00
|
|
|
- pnpm run build
|
2023-10-11 22:43:31 +00:00
|
|
|
- cd /woodpecker/src/git.mzhang.io/michael/blog
|
2023-10-11 22:42:41 +00:00
|
|
|
- pnpm install
|
|
|
|
- pnpm link /tmp/astro/packages/astro
|
|
|
|
- pnpm link /tmp/astro/packages/markdown/remark
|
2023-10-11 22:27:24 +00:00
|
|
|
- pnpm run build
|
2023-02-04 07:04:29 +00:00
|
|
|
|
|
|
|
deploy:
|
|
|
|
image: alpine
|
|
|
|
commands:
|
2023-02-04 07:11:56 +00:00
|
|
|
- apk add rsync openssh
|
2023-02-04 07:18:38 +00:00
|
|
|
- echo "$${SSH_SECRET_KEY}" > SSH_SECRET_KEY
|
2023-02-04 07:12:21 +00:00
|
|
|
- chmod 600 SSH_SECRET_KEY
|
2023-02-04 07:10:28 +00:00
|
|
|
- mkdir -p ~/.ssh
|
2023-02-04 07:04:29 +00:00
|
|
|
- echo "mzhang.io ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBzBZ+QmM4EO3Fwc1ZcvWV2IY9VF04T0H9brorGj9Udp" >> ~/.ssh/known_hosts
|
2023-09-08 10:15:25 +00:00
|
|
|
- rsync -azrP -e "ssh -i SSH_SECRET_KEY" dist/ sourcehutBuilds@mzhang.io:/mnt/storage/svcdata/blog-public
|
2023-08-31 08:07:03 +00:00
|
|
|
secrets: [SSH_SECRET_KEY]
|
2023-02-04 07:04:29 +00:00
|
|
|
when:
|
|
|
|
branch: master
|