Skip to content

Commit 5b79389

Browse files
authored
Merge pull request #39 from UMC-7th-CAU-NodeJS/feature/add-deploy-pipeline
Update deploy-main.yml
2 parents 09cc5a9 + 32314d1 commit 5b79389

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/deploy-main.yml

+15-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ jobs:
1313
- name: Checkout
1414
uses: actions/checkout@v4
1515

16+
- name: Check prisma has changes
17+
uses: dorny/paths-filter@v3
18+
id: paths-filter
19+
with:
20+
filters: |
21+
prisma: ["prisma/**"]
22+
1623
- name: Configure SSH
1724
run: |
1825
mkdir -p ~/.ssh
@@ -39,7 +46,13 @@ jobs:
3946
4047
- name: Install dependencies
4148
run: |
42-
ssh playground-umc-7th 'npm install --prefix /opt/app/'
49+
ssh playground-umc-7th 'cd /opt/app; npm install'
50+
ssh playground-umc-7th 'cd /opt/app; npm exec prisma generate'
51+
52+
- name: Apply prisma migrations
53+
if: steps.paths-filter.outputs.prisma == 'true'
54+
run: |
55+
ssh playground-umc-7th 'cd /opt/app; npm exec prisma migrate deploy'
4356
4457
- name: Copy systemd service file
4558
run: |
@@ -50,7 +63,7 @@ jobs:
5063
5164
[Service]
5265
User=${USER}
53-
ExecStart=/usr/bin/npm run dev --prefix /opt/app/
66+
ExecStart=/usr/bin/npm run start --prefix /opt/app/
5467
Restart=always
5568
5669
[Install]

0 commit comments

Comments
 (0)