Skip to content

Commit

Permalink
Deploy on VPS
Browse files Browse the repository at this point in the history
Signed-off-by: CYB3RL1F3 <[email protected]>
  • Loading branch information
CYB3RL1F3 committed Sep 24, 2024
1 parent e1e0f8a commit 3db0c1f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,29 @@ jobs:
with:
ssh-private-key: ${{ secrets.VPS_SSH_KEY }}

- name: Add server to known_hosts
run: |
mkdir -p ~/.ssh
ssh-keyscan -H ${{ secrets.VPS_IP }} >> ~/.ssh/known_hosts
# 3. Déployer sur le VPS
- name: Deploy to VPS
env:
VPS_IP: ${{ secrets.VPS_IP }}
VPS_USER: ${{ secrets.VPS_USER }}
run: |
if [ -z "$VPS_USER" ]; then
echo "Error: VPS_USER is not set."
exit 1
else
echo "VPS_USER is set."
fi
if [ -z "$VPS_IP" ]; then
echo "Error: VPS_IP is not set."
exit 1
else
echo "VPS_IP is set."
fi
if [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
echo "Deploy in production environment"
Expand Down

0 comments on commit 3db0c1f

Please sign in to comment.