Added deploy script after successfull check on commit
Moorly Website CI / build (push) Successful in 6s
Moorly Website CI / build (push) Successful in 6s
This commit is contained in:
1 parent
3b318038a6
commit
2284236ef5
3 files changed
+296
No files matched your search
@@ -1,3 +1,4 @@
|
||||
|
||||
name: Moorly Website CI
|
||||
|
||||
on:
|
||||
@@ -32,3 +33,22 @@ jobs:
|
||||
- name: Security audit
|
||||
run: npm audit
|
||||
|
||||
- name: Deploy dev
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/dev'
|
||||
env:
|
||||
DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
|
||||
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
|
||||
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
|
||||
run: |
|
||||
set -eu
|
||||
|
||||
KEY_FILE="$(mktemp)"
|
||||
trap 'rm -f "$KEY_FILE"' EXIT
|
||||
|
||||
printf '%s\n' "$DEPLOY_SSH_KEY" > "$KEY_FILE"
|
||||
chmod 600 "$KEY_FILE"
|
||||
|
||||
rsync -az --delete \
|
||||
-e "ssh -i $KEY_FILE -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes -o UserKnownHostsFile=$HOME/.ssh/known_hosts" \
|
||||
dist/ "${DEPLOY_USER}@${DEPLOY_HOST}:/var/MoorlyWeb/dev/"
|
||||
|
||||
Reference in new issue
Block a user