feat: automate .env deployment via GitHub Secrets and local file sync

This commit is contained in:
MythEclipse
2026-05-17 21:24:54 +07:00
parent f35710db3f
commit 8584030633
2 changed files with 17 additions and 1 deletions
+6 -1
View File
@@ -15,16 +15,21 @@ jobs:
- name: Deploy via SSH
uses: appleboy/ssh-action@v1.0.3
env:
ENV_FILE: ${{ secrets.ENV_FILE }}
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USERNAME }}
key: ${{ secrets.VPS_SSH_KEY }}
envs: ENV_FILE
script: |
# Modify this path to where your project is stored on the VPS
cd /opt/imphenbot || exit
# Pull latest changes
git pull origin main
# Write environment variables from GitHub Secrets
echo "$ENV_FILE" > .env
# Build and restart containers
docker-compose up -d --build