mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-30 05:41:12 +00:00
parent
bfb9af121c
commit
8584bbd073
1 changed files with 29 additions and 28 deletions
|
@ -2,39 +2,40 @@ clone:
|
||||||
git:
|
git:
|
||||||
image: plugins/git:next
|
image: plugins/git:next
|
||||||
|
|
||||||
branches: master
|
|
||||||
|
|
||||||
pipeline:
|
pipeline:
|
||||||
deploy-docs:
|
build:
|
||||||
image: node:14-alpine
|
|
||||||
secrets:
|
|
||||||
- BOT_PRIVATE_KEY
|
|
||||||
environment:
|
|
||||||
- USE_SSH=true
|
|
||||||
- GIT_USER=woodpecker-bot
|
|
||||||
- DEPLOYMENT_BRANCH=master
|
|
||||||
commands:
|
|
||||||
- apk add openssh-client git
|
|
||||||
- mkdir -p $HOME/.ssh
|
|
||||||
- ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
|
|
||||||
- echo "$BOT_PRIVATE_KEY" > $HOME/.ssh/id_rsa
|
|
||||||
- chmod 0600 $HOME/.ssh/id_rsa
|
|
||||||
- git config --global user.email "woodpecker-bot@obermui.de"
|
|
||||||
- git config --global user.name "woodpecker-bot"
|
|
||||||
- cd docs/
|
|
||||||
- yarn install --frozen-lockfile
|
|
||||||
- yarn deploy
|
|
||||||
when:
|
|
||||||
event: push
|
|
||||||
branch: master
|
|
||||||
path: "docs/**"
|
|
||||||
|
|
||||||
build-docs-pr:
|
|
||||||
image: node:14-alpine
|
image: node:14-alpine
|
||||||
commands:
|
commands:
|
||||||
- cd docs/
|
- cd docs/
|
||||||
- yarn install --frozen-lockfile
|
- yarn install --frozen-lockfile
|
||||||
- yarn build
|
- yarn build
|
||||||
when:
|
when:
|
||||||
event: [pull_request]
|
event: [push, pull_request]
|
||||||
path: "docs/**"
|
path: "docs/**"
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
image: alpine:3.14.2
|
||||||
|
secrets:
|
||||||
|
- BOT_PRIVATE_KEY
|
||||||
|
commands:
|
||||||
|
- apk add openssh-client git rsync
|
||||||
|
- mkdir -p $HOME/.ssh
|
||||||
|
- ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
|
||||||
|
- echo "$BOT_PRIVATE_KEY" > $HOME/.ssh/id_rsa
|
||||||
|
- chmod 0600 $HOME/.ssh/id_rsa
|
||||||
|
- git config --global user.email "woodpecker-bot@obermui.de"
|
||||||
|
- git config --global user.name "woodpecker-bot"
|
||||||
|
- git clone -b master --single-branch git@github.com:woodpecker-ci/woodpecker-ci.github.io.git /repo
|
||||||
|
# copy all docs files and delete all old ones, but leave CNAME and index.yaml untouched
|
||||||
|
- rsync -r --exclude .git --exclude CNAME --exclude index.yaml --exclude README.md --delete docs/build/ /repo
|
||||||
|
- cd /repo
|
||||||
|
- git add .
|
||||||
|
# exit successfully if nothing changed
|
||||||
|
- test -n "$(git status --porcelain)" || exit 0
|
||||||
|
- git commit -m "Deploy website - based on ${DRONE_COMMIT_SHA}"
|
||||||
|
- git push
|
||||||
|
when:
|
||||||
|
event: push
|
||||||
|
branch: master
|
||||||
|
path: "docs/**"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue