Notes/.woodpecker.yml

18 lines
613 B
YAML

# .woodpecker.yml
steps:
- name: build & copy
image: node:18-alpine
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
- chmod 600 /root/.ssh/id_rsa
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config
- npm install
- npm run build
- ssh "$REMOTE_HOST" 'rm -rf "$PROJECT_DIRECTORY/*"'
- scp -r build/* "$REMOTE_HOST":$PROJECT_DIRECTORY
secrets: [SSH_KEY, REMOTE_HOST, PROJECT_DIRECTORY]