Fix Woodpecker config (14)

This commit is contained in:
lostinlight 2022-01-22 13:40:28 +03:00
parent 9f07d919a9
commit 25a6304bee

View file

@ -9,12 +9,16 @@ pipeline:
- test -e package.json && npm install - test -e package.json && npm install
- gulp build --cwd ./themes/starter - gulp build --cwd ./themes/starter
- hexo generate - hexo generate
- find -maxdepth 1 ! -name .git ! -name .domains ! -name public ! -name . -exec rm -rf {} \;
# This only copies non-hidden files; those whose names start with period WOULD NOT be copied
- mv public/* .
- rm -rf public
when: when:
branch: branch:
include: [ main ] include: [ main ]
event: [push, deployment] event: [push, deployment]
publish: commit:
image: alpine image: alpine
secrets: [ access_token ] secrets: [ access_token ]
commands: commands:
@ -22,12 +26,28 @@ pipeline:
# configure git # configure git
- git config --global user.email "nonexistent@example.com" - git config --global user.email "nonexistent@example.com"
- git config --global user.name "Codeberg CI" - git config --global user.name "Codeberg CI"
- git clone https://"$${ACCESS_TOKEN}"@codeberg.org/fediverse/fediparty.git pages
- cd pages
- git checkout -b pages - git checkout -b pages
- mv ../public/* .
- mv ../.domains .
# deploy changes # deploy changes
- git add -A - git add -A
- git commit -m "Woodpecker build ${CI_COMMIT_SHA}" - git commit -m "Woodpecker build ${CI_COMMIT_SHA}"
- git push --force origin pages
# Push step: it pushes the build output to "pages" branch
push:
image: appleboy/drone-git-push
settings:
branch: pages
remote: git@codeberg.org:fediverse/fediparty.git
# To work around "rejected...fetch first" error
force: true
ssh_key:
from_secret: ssh_key
when:
# Only try to commit if previous step is successful
status: success
branch:
# Only run on these branches
include: [ main ]
# ...and never on pages branch (to ignore build triggered by CI commits)
exclude: pages
# Execute on every event except "pull_request"
event: [push, tag, deployment]