|
1 | | -name: Node - SSH deploy |
| 1 | +name: Prod deploy |
2 | 2 |
|
3 | 3 | # Controls when the action will run. |
4 | 4 | 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 |
10 | 14 |
|
11 | 15 | 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 |
15 | 20 |
|
16 | | - steps: |
17 | | - - name: 🚚 Get latest code |
18 | | - uses: actions/checkout@v2 |
| 21 | + steps: |
| 22 | + - name: 🚚 Get latest code |
| 23 | + uses: actions/checkout@v2 |
19 | 24 |
|
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' |
24 | 29 |
|
25 | | - - name: 🔨 Build Project |
26 | | - run: | |
27 | | - yarn |
28 | | - yarn build |
| 30 | + - name: 🔨 Build Project |
| 31 | + run: | |
| 32 | + yarn |
| 33 | + yarn build |
29 | 34 |
|
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