Skip to content

Commit cfed7d5

Browse files
deploy via PR only
1 parent 8ae3eb6 commit cfed7d5

1 file changed

Lines changed: 35 additions & 30 deletions

File tree

.github/workflows/prod.yml

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,44 @@
1-
name: Node - SSH deploy
1+
name: Prod deploy
22

33
# Controls when the action will run.
44
on:
5-
# Triggers the workflow on push or pull request events but only for the master branch
6-
push:
7-
branches: [main]
8-
pull_request:
9-
branches: [main]
5+
# Triggers the workflow on push or pull request events but only for the master branch
6+
push:
7+
branches:
8+
- main
9+
pull_request:
10+
types:
11+
- closed
12+
branches:
13+
- main
1014

1115
jobs:
12-
SFTP-deploy:
13-
name: 🎉 Deploy
14-
runs-on: ubuntu-latest
16+
if_merged:
17+
if: github.event.pull_request.merged == true
18+
name: 🎉 Deploy
19+
runs-on: ubuntu-latest
1520

16-
steps:
17-
- name: 🚚 Get latest code
18-
uses: actions/checkout@v2
21+
steps:
22+
- name: 🚚 Get latest code
23+
uses: actions/checkout@v2
1924

20-
- name: Use Node.js 16
21-
uses: actions/setup-node@v2-beta
22-
with:
23-
node-version: '16'
25+
- name: Use Node.js 16
26+
uses: actions/setup-node@v2-beta
27+
with:
28+
node-version: '16'
2429

25-
- name: 🔨 Build Project
26-
run: |
27-
yarn
28-
yarn build
30+
- name: 🔨 Build Project
31+
run: |
32+
yarn
33+
yarn build
2934
30-
- name: 📂 Deploy to Server
31-
uses: easingthemes/ssh-deploy@v2.1.5
32-
env:
33-
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
34-
# ARGS: "-rltgoDzvO --delete"
35-
SOURCE: 'build/'
36-
REMOTE_HOST: 192.34.62.123
37-
REMOTE_USER: berry
38-
TARGET: public_html/free
39-
EXCLUDE: '/dist/, /node_modules/'
35+
- name: 📂 Deploy to Server
36+
uses: easingthemes/ssh-deploy@v2.1.5
37+
env:
38+
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
39+
# ARGS: "-rltgoDzvO --delete"
40+
SOURCE: 'build/'
41+
REMOTE_HOST: 192.34.62.123
42+
REMOTE_USER: berry
43+
TARGET: public_html/free
44+
EXCLUDE: '/dist/, /node_modules/'

0 commit comments

Comments
 (0)