This commit is contained in:
1 parent
da0104d9dc
commit
5851e05acd
1 file changed
+9
-18
@@ -8,21 +8,11 @@ jobs:
|
|||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
# 1. Debugging stap: Deze stap onthult direct of de secret door Gitea wordt doorgegeven.
|
|
||||||
- name: Debug Secret
|
|
||||||
run: |
|
|
||||||
if [ -z "${{ secrets.VPS_HOST }}" ]; then
|
|
||||||
echo "FOUT: VPS_HOST secret is leeg of niet beschikbaar!"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "VPS_HOST is succesvol geladen."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 2. De Deployment stap
|
|
||||||
- name: Deploying via SSH connection to VPS Host
|
- name: Deploying via SSH connection to VPS Host
|
||||||
uses: appleboy/[email protected]
|
uses: appleboy/[email protected]
|
||||||
with:
|
with:
|
||||||
host: ${{ secrets.VPS_HOST }}
|
# We omzeilen secrets hier volledig om de "leeg" foutmelding te stoppen
|
||||||
|
host: "172.20.2.1"
|
||||||
username: "root"
|
username: "root"
|
||||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
port: 22
|
port: 22
|
||||||
@@ -32,21 +22,22 @@ jobs:
|
|||||||
|
|
||||||
cd /var/www/atom-nexst/
|
cd /var/www/atom-nexst/
|
||||||
|
|
||||||
# Update de code
|
# 1. Veilige update
|
||||||
git fetch origin --prune
|
git fetch origin --prune
|
||||||
git reset --hard origin/main
|
git reset --hard origin/main
|
||||||
|
|
||||||
# Cleanup
|
# 2. Cleanup
|
||||||
if [ -d "directory-name" ]; then rm -rf directory-name; fi
|
if [ -d "directory-name" ]; then rm -rf directory-name; fi
|
||||||
|
|
||||||
# Installeer en bouw
|
# 3. Dependencies
|
||||||
# Gebruik het volledige pad voor pnpm (controleer dit met 'which pnpm' op je server)
|
|
||||||
/usr/local/bin/pnpm install --frozen-lockfile
|
/usr/local/bin/pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
# 4. Database en Types
|
||||||
/usr/local/bin/pnpm db:migrate
|
/usr/local/bin/pnpm db:migrate
|
||||||
/usr/local/bin/pnpm prisma generate
|
/usr/local/bin/pnpm prisma generate
|
||||||
/usr/local/bin/pnpm build
|
|
||||||
|
|
||||||
# Restart
|
# 5. Build en Restart
|
||||||
|
/usr/local/bin/pnpm build
|
||||||
sudo systemctl restart atom-nexst.service
|
sudo systemctl restart atom-nexst.service
|
||||||
|
|
||||||
echo "--- EPIC WEB CONTROL Deployment Completed Successfully ---"
|
echo "--- EPIC WEB CONTROL Deployment Completed Successfully ---"
|
||||||
|
|||||||
Reference in new issue
Block a user