blog/.woodpecker.yml

30 lines
953 B
YAML
Raw Normal View History

2024-05-02 20:48:55 +00:00
steps:
2023-02-04 07:04:29 +00:00
build:
2023-10-24 19:05:09 +00:00
image: node:20
2023-02-04 07:04:29 +00:00
commands:
2023-10-24 19:05:49 +00:00
- npm install -g pnpm
2023-10-12 23:34:57 +00:00
# - cd /tmp
# - rm -rf astro
# - git clone https://git.mzhang.io/michael/astro --depth 1
# - cd astro
# - pnpm install
# - pnpm run build
# - cd /woodpecker/src/git.mzhang.io/michael/blog
2023-10-11 22:27:24 +00:00
- pnpm install
2023-10-12 23:34:57 +00:00
# - 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