blog/.woodpecker.yml

30 lines
939 B
YAML
Raw Normal View History

2024-05-02 20:48:55 +00:00
steps:
2023-02-04 07:04:29 +00:00
build:
image: node:20
2023-02-04 07:04:29 +00:00
commands:
- npm install -g pnpm
# - 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
- pnpm install
# - pnpm link /tmp/astro/packages/astro
# - pnpm link /tmp/astro/packages/markdown/remark
- 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
2024-05-02 20:51:23 +00:00
- echo "mzhang.io ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO+RKFYjD8UjqhfOHFHNyijkbGzC4fJEIIhrBwHj+FsQ" >> ~/.ssh/known_hosts
- rsync -azrP -e "ssh -i SSH_SECRET_KEY" dist/ blogDeploy@mzhang.io:/home/blogDeploy/public
2023-08-31 08:07:03 +00:00
secrets: [SSH_SECRET_KEY]
2023-02-04 07:04:29 +00:00
when:
branch: master