2024-10-14 19:03:10 +08:00
|
|
|
# .woodpecker.yml
|
|
|
|
steps:
|
|
|
|
- name: build & copy
|
2024-10-14 19:52:44 +08:00
|
|
|
image: node:18-alpine
|
2024-10-14 19:03:10 +08:00
|
|
|
when:
|
|
|
|
- branch: master
|
|
|
|
event: push
|
|
|
|
commands:
|
|
|
|
- apk add --no-cache openssh-client
|
|
|
|
- mkdir -p /root/.ssh/
|
|
|
|
- echo "$SSH_KEY" | tr -d '\r' > /root/.ssh/id_rsa
|
2024-10-16 15:27:00 +08:00
|
|
|
- chmod 600 /root/.ssh/id_rsa
|
2024-10-14 19:03:10 +08:00
|
|
|
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config
|
|
|
|
- npm install
|
|
|
|
- npm run build
|
2024-10-15 22:09:31 +08:00
|
|
|
- scp -r build/* "$REMOTE_HOST":"$PROJECT_DIRECTORY"
|
2024-10-14 19:11:30 +08:00
|
|
|
secrets: [SSH_KEY, REMOTE_HOST, PROJECT_DIRECTORY]
|