Skip to content

Commit ffe4184

Browse files
authored
Create deploy-staging.yml
1 parent 7e264e7 commit ffe4184

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: "Deploy Staging"
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Setup SSH
17+
run: |
18+
mkdir -p ~/.ssh
19+
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
20+
chmod 600 ~/.ssh/id_rsa
21+
ssh-keyscan -H ${{ secrets.STAGING_IP }} >> ~/.ssh/known_hosts
22+
23+
- name: Deploy via SSH
24+
run: |
25+
ssh ${{ secrets.SERVER_USER }}@${{ secrets.STAGING_IP }} << 'EOF'
26+
cd /home/modl/modl-shared-web
27+
git pull origin main
28+
npm install
29+
npm run build
30+
EOF

0 commit comments

Comments
 (0)