Edit CI config

This commit is contained in:
lostinlight 2022-01-29 16:43:26 +03:00
parent f7c8d8f8f4
commit c0bb240e9a

View file

@ -9,15 +9,28 @@ pipeline:
- test -e package.json && npm install
- gulp build --cwd ./themes/starter
- 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:
branch:
include: [ main ]
event: [push, deployment]
deploy:
image: alpine
secrets: [ deploy_key ]
commands:
- apk add rsync
- mkdir .ssh
- printf '%s\n' "$${DEPLOY_KEY}" > ~/.ssh/deploy_key
- printf "Host alexandria.debiania.in.ua\n\tIdentityFile ~/.ssh/deploy_key\n\tUserKnownHostsFile=/dev/null\n\tStrictHostKeyChecking=no\n" > ~/.ssh/config
- chmod -R u=rwX,go= ~/.ssh
- rsync -rPvce ssh --chmod=ugo=rwX --no-times public/ www-fediparty@alexandria.debiania.in.ua:www/
when:
# Only try to deploy if previous step is successful
status: success
branch:
include: [ main ]
event: [push, deployment]
commit:
image: alpine
secrets: [ ssh_key ]
@ -26,6 +39,10 @@ pipeline:
# configure git
- git config --global user.email "nonexistent@example.com"
- git config --global user.name "Codeberg CI"
- 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
- git checkout -b pages
# deploy changes
- git add -A