Skip to content

Commit

Permalink
Update deploy.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
privatebydefault authored Feb 9, 2025
1 parent 6c3b2d3 commit c303025
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ jobs:
key: ${{ secrets.VPS_PRIVATE_KEY }}
port: ${{ secrets.VPS_PORT }}
script: |
# Safely remove only files we own
find /var/www/html -user $USER -exec rm -rf {} \; || true
mkdir -p /var/www/html
command_timeout: 2m
sudo rm -rf /var/www/html/*
sudo mkdir -p /var/www/html
command_timeout: 1m

- name: Deploy to VPS
uses: appleboy/scp-action@master
Expand All @@ -61,14 +60,13 @@ jobs:
port: ${{ secrets.VPS_PORT }}
source: "out/"
target: "/var/www/html"
rm: true
strip_components: 0
overwrite: true

- name: Restart Caddy on VPS
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.VPS_HOST }}
username: caddy_restart # Match your sudoers user
username: ${{ secrets.VPS_USERNAME }}
key: ${{ secrets.VPS_PRIVATE_KEY }}
port: ${{ secrets.VPS_PORT }}
script: |
Expand Down

0 comments on commit c303025

Please sign in to comment.