Skip to content

Commit 6fd8a25

Browse files
committed
[Deployment] Workflow
1 parent e584ebd commit 6fd8a25

File tree

2 files changed

+39
-14
lines changed

2 files changed

+39
-14
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Deploy Zodiac Server
2+
3+
on:
4+
push:
5+
branches:
6+
- dev_hari
7+
- dev-fan
8+
- dev_mario
9+
- dev_fang
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Check out the repository
17+
uses: actions/checkout@v3
18+
19+
- name: Install dependencies
20+
run: yarn install --frozen-lockfile
21+
22+
- name: Build React App
23+
run: yarn build
24+
25+
- name: Determine Branch Name
26+
id: get_branch
27+
run: echo "branch_name=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
28+
29+
- name: Copy files to the server via SFTP
30+
uses: wlixcc/[email protected]
31+
with:
32+
server: ${{ secrets.NEUROJ_SERVER }}
33+
username: ${{ secrets.NEUROJ_SERVER_USER }}
34+
ssh_private_key: ${{ secrets.NEUROJ_SERVER_SSH_KEY }}
35+
local_path: "./build/*"
36+
remote_path: "/var/www/html/dev/${{ env.branch_name }}/"

.github/workflows/validate.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ on:
55
branches:
66
- "*"
77

8-
push:
9-
branches:
10-
- main # Runs on push to main
11-
128
jobs:
139
validate:
1410
runs-on: ubuntu-latest
@@ -25,18 +21,11 @@ jobs:
2521
- name: Install dependencies
2622
run: yarn install
2723

24+
- name: Run Linter (Report Issues)
25+
run: yarn lint
26+
2827
- name: Compile TypeScript
2928
run: yarn build
3029

3130
- name: Run Security Audit
3231
run: yarn audit --level moderate
33-
34-
- name: Copy files to the server via SFTP
35-
if: github.ref == 'refs/heads/main'
36-
uses: wlixcc/[email protected]
37-
with:
38-
server: ${{ secrets.NEUROJ_SERVER }}
39-
username: ${{ secrets.NEUROJ_SERVER_USER }}
40-
ssh_private_key: ${{ secrets.NEUROJ_SERVER_SSH_KEY }}
41-
local_path: "./*"
42-
remote_path: "/var/www/html/dev/${{ github.actor }}/"

0 commit comments

Comments
 (0)