Skip to content

Commit 3615691

Browse files
Stage (#3)
* Create main.yml * Create prod.yml * Update prod.yml * Update package.json
1 parent 03454d6 commit 3615691

File tree

3 files changed

+90
-2
lines changed

3 files changed

+90
-2
lines changed

.github/workflows/main.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Stage deploy
2+
3+
# Controls when the action will run.
4+
on:
5+
# Triggers the workflow on push or pull request events but only for the master branch
6+
push:
7+
branches:
8+
- stage*
9+
pull_request:
10+
types:
11+
- closed
12+
branches:
13+
- stage*
14+
15+
jobs:
16+
if_merged:
17+
if: github.event.pull_request.merged == true
18+
name: 🎉 Deploy
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: 🚚 Get latest code
23+
uses: actions/checkout@v4
24+
25+
- name: Use Node.js 20
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: "20"
29+
30+
- name: 🔨 Build Project
31+
run: |
32+
npm i
33+
npm run build-stage
34+
35+
- name: 📂 Deploy to Server
36+
uses: easingthemes/ssh-deploy@v4
37+
env:
38+
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
39+
# ARGS: "-rltgoDzvO --delete"
40+
SOURCE: "dist/"
41+
REMOTE_HOST: 192.34.62.123
42+
REMOTE_USER: mantis
43+
TARGET: public_html/vue/free/stage
44+
EXCLUDE: "/node_modules/"

.github/workflows/prod.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Prod deploy
2+
3+
# Controls when the action will run.
4+
on:
5+
# Triggers the workflow on push or pull request events but only for the master branch
6+
push:
7+
branches:
8+
- master
9+
pull_request:
10+
types:
11+
- closed
12+
branches:
13+
- master
14+
15+
jobs:
16+
if_merged:
17+
if: github.event.pull_request.merged == true
18+
name: 🎉 Deploy
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: 🚚 Get latest code
23+
uses: actions/checkout@v4
24+
25+
- name: Use Node.js 20
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: "20"
29+
30+
- name: 🔨 Build Project
31+
run: |
32+
npm i
33+
npm run build-prod
34+
35+
- name: 📂 Deploy to Server
36+
uses: easingthemes/ssh-deploy@v4
37+
env:
38+
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
39+
# ARGS: "-rltgoDzvO --delete"
40+
SOURCE: "dist/"
41+
REMOTE_HOST: 192.34.62.123
42+
REMOTE_USER: mantis
43+
TARGET: public_html/vue/free
44+
EXCLUDE: "/node_modules/"

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"scripts": {
77
"dev": "vite",
88
"build": "vue-tsc --noEmit && vite build",
9-
"build-stage": "vue-tsc --noEmit && vite build --base=/vue/stage/",
10-
"build-prod": "vue-tsc --noEmit && vite build --base=/vue/",
9+
"build-stage": "vue-tsc --noEmit && vite build --base=/vue/free/stage/",
10+
"build-prod": "vue-tsc --noEmit && vite build --base=/vue/free/",
1111
"preview": "vite preview --port 5050",
1212
"typecheck": "vue-tsc --noEmit",
1313
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"

0 commit comments

Comments
 (0)