-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.06 KB
/
deploy-prod.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Deploy on production server
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy production build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [21.x]
steps:
- name: Deploying
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
password: ${{ secrets.SERVER_PASSWORD }}
script: |
# Change directory to project directory
cd mcdata-api
# Load environment variables
echo "
APP_NAME=${{ vars.APP_NAME }}
APP_ENV=${{ vars.APP_ENV }}
APP_PORT=${{ vars.APP_PORT }}
APP_URL=${{ vars.APP_URL }}
" > .env
# Pull newest code
git pull
# Install newest dependencies
yarn install --frozen-lockfile
# Build production code
yarn build
# Restart process manager
pm2 restart "mcdata-api"