Dev #1

Merged
Squid merged 4 commits from dev into main 2026-11-05 21:11:19 +01:00
Showing only changes of commit 1327350c66 - Show all commits
+18 -3
View File
@@ -5,6 +5,7 @@ on:
push: push:
branches: branches:
- dev - dev
- main
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@@ -33,8 +34,9 @@ jobs:
- name: Security audit - name: Security audit
run: npm audit run: npm audit
- name: Deploy dev
if: github.event_name == 'push' && github.ref == 'refs/heads/dev' - name: Deploy website
if: github.event_name == 'push' && (github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main')
env: env:
DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }} DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
@@ -42,6 +44,19 @@ jobs:
run: | run: |
set -eu set -eu
case "$GITHUB_REF" in
refs/heads/dev)
DEPLOY_PATH="/var/MoorlyWeb/dev/"
;;
refs/heads/main)
DEPLOY_PATH="/var/MoorlyWeb/production/"
;;
*)
echo "Unsupported branch: $GITHUB_REF"
exit 1
;;
esac
KEY_FILE="$(mktemp)" KEY_FILE="$(mktemp)"
trap 'rm -f "$KEY_FILE"' EXIT trap 'rm -f "$KEY_FILE"' EXIT
@@ -50,5 +65,5 @@ jobs:
rsync -az --delete \ rsync -az --delete \
-e "ssh -i $KEY_FILE -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes -o UserKnownHostsFile=$HOME/.ssh/known_hosts" \ -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/" dist/ "${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}"