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