Add .woodpecker.yml
This commit is contained in:
46
.woodpecker.yml
Normal file
46
.woodpecker.yml
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
steps:
|
||||||
|
build:
|
||||||
|
image: alpine
|
||||||
|
|
||||||
|
commands:
|
||||||
|
- apk add --no-cache rsync
|
||||||
|
- rm -rf site
|
||||||
|
- mkdir -p site
|
||||||
|
- rsync -a --exclude site --exclude .git ./ site/
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
image: alpine/git
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
- source: pages_token
|
||||||
|
target: pages_token
|
||||||
|
|
||||||
|
commands:
|
||||||
|
- echo "$pages_token" | wc -c
|
||||||
|
|
||||||
|
- git config --global user.name admin
|
||||||
|
- git config --global user.email admin@backend-3.com
|
||||||
|
|
||||||
|
- git clone https://admin:${pages_token}@git.backend-3.com/admin/font-design.git deploy
|
||||||
|
|
||||||
|
- cd deploy
|
||||||
|
|
||||||
|
- git checkout gh-pages || git checkout --orphan gh-pages
|
||||||
|
|
||||||
|
- find . -mindepth 1 -maxdepth 1 ! -name .git -exec rm -rf {} +
|
||||||
|
|
||||||
|
- cp -r ../site/. .
|
||||||
|
|
||||||
|
- git add .
|
||||||
|
|
||||||
|
- git commit -m "deploy $(date +%s)" || true
|
||||||
|
|
||||||
|
- git push origin gh-pages --force
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- build
|
||||||
|
|
||||||
|
when:
|
||||||
|
- event: push
|
||||||
|
- event: manual
|
||||||
|
- branch: main
|
||||||
Reference in New Issue
Block a user