Skip to content

Commit

Permalink
Upload to tmp folder then copy into web server folder then remove tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelclapham authored Sep 7, 2024
1 parent 1b12800 commit ce12962
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: '20'

- run: npm install

- run: npm run build

- run: sudo apt-get install tree
- run: tree build

- name: Upload site files
uses: appleboy/[email protected]
with:
Expand All @@ -33,7 +37,24 @@ jobs:
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
source: "build"
target: /var/www/qrsync
target: /var/www/qrsync/tmp
overwrite: true


- name: Move site files from tmp folder
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: cp "/var/www/qrsync/tmp/*" /var/www/qrsync

- name: Remove tmp folder
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: rm -rf /var/www/qrsync/tmp

0 comments on commit ce12962

Please sign in to comment.