Fix Woodpecker config (17)

This commit is contained in:
lostinlight 2022-01-22 15:51:40 +03:00
parent 3bba7696cd
commit e1a5abb202
1 changed files with 8 additions and 18 deletions

View File

@ -20,8 +20,9 @@ pipeline:
commit:
image: alpine
secrets: [ ssh_key ]
commands:
- apk add git
- apk add git openssh
# configure git
- git config --global user.email "nonexistent@example.com"
- git config --global user.name "Codeberg CI"
@ -29,25 +30,14 @@ pipeline:
# deploy changes
- git add -A
- git commit -m "Woodpecker build ${CI_COMMIT_SHA}"
# Push step: it pushes the build output to "pages" branch
push:
image: appleboy/drone-git-push
secrets:
- source: ssh_key
target: plugin_ssh_key
settings:
branch: pages
remote: git@codeberg.org:fediverse/fediparty.git
# To work around "rejected...fetch first" error
force: true
- printf '%s\n' "$${SSH_KEY}" > ./key
- chmod 600 ./key
- ssh-keygen -l -f ./key
- git remote set-url origin git@codeberg.org:fediverse/fediparty.git
- GIT_SSH_COMMAND='ssh -vvv -i .././key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' git push --force origin pages
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]
event: [push, deployment]