Update .forgejo/workflows/deploy.yaml
All checks were successful
deploy blog / deploy (push) Successful in 55s
All checks were successful
deploy blog / deploy (push) Successful in 55s
This commit is contained in:
parent
27ef15a13d
commit
4d20090853
1 changed files with 8 additions and 10 deletions
|
|
@ -35,20 +35,18 @@ jobs:
|
|||
env:
|
||||
SSH_PRIVATE_KEY: ${{ forgejo.ref_name == 'production' && secrets.SSH_PRIVATE_KEY_PRODUCTION || secrets.SSH_PRIVATE_KEY_STAGING }}
|
||||
run: |
|
||||
mkdir -p .ssh
|
||||
echo "${{ secrets.KNOWN_HOSTS }}" | base64 -d > .ssh/known_hosts
|
||||
printf "%s" "$SSH_PRIVATE_KEY" | base64 -d > .ssh/id_ed25519
|
||||
chmod 600 .ssh/id_ed25519
|
||||
ssh-keygen -f .ssh/id_ed25519 -y > .ssh/id_ed25519.pub
|
||||
cat .ssh/id_ed25519.pub
|
||||
mkdir -p ~/.ssh
|
||||
printf "%s" "${{ secrets.KNOWN_HOSTS }}" | base64 -d > ~/.ssh/known_hosts
|
||||
printf "%s" "$SSH_PRIVATE_KEY" | base64 -d > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
ssh-keygen -f ~/.ssh/id_ed25519 -y > ~/.ssh/id_ed25519.pub
|
||||
cat ~/.ssh/id_ed25519.pub
|
||||
|
||||
- name: Sync rendered site to staging
|
||||
env:
|
||||
DEPLOY_DIR: ${{ forgejo.ref_name == 'production' && '/srv/http/www/' || '/srv/http/www-staging/' }}
|
||||
run: rsync -var -e 'ssh -i .ssh/id_ed25519 -o StrictHostKeyChecking=no' ./public/ deploy@www.berlin.ccc.de:$DEPLOY_DIR
|
||||
|
||||
- run: cat ~/.ssh/known_hosts
|
||||
run: rsync -var -e 'ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=no' ./public/ deploy@www.berlin.ccc.de:$DEPLOY_DIR
|
||||
|
||||
- name: Cleanup
|
||||
if: ${{ always() }}
|
||||
run: rm -rf .ssh
|
||||
run: rm -rf ~/.ssh
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue