Skip to content

Commit 67eb857

Browse files
committed
Add GitHub Action for Preview environment deployment
1 parent 8dd0426 commit 67eb857

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/deploy-preview.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# GitHub Action to deploy WebPerformance Report Static Site on preview
2+
name: Deploy Preview
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
jobs:
8+
deploy-staging:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Execute remote SSH commands using SSH key
12+
uses: appleboy/ssh-action@master
13+
with:
14+
host: ${{ secrets.SSH_HOST_DEV_SERVER }}
15+
username: ${{ secrets.SSH_USERNAME_DEV_SERVER }}
16+
key: ${{ secrets.SSH_PRIVATE_KEY_DEV_SERVER }}
17+
script: |
18+
# Navigate to the project directory
19+
cd /var/www/vhosts/webperformancereport.com/preview.webperformancereport.com/
20+
21+
# Pull the latest code
22+
echo "Pulling latest code..."
23+
git pull https://${{ secrets.ORG_GIT_TOKEN }}@github.com/WebPerformanceReport/wpr-static-site.git dev
24+

0 commit comments

Comments
 (0)