-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (34 loc) · 975 Bytes
/
cd.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
name: CD
on:
push:
branches: ["main"]
paths-ignore:
- "**/README.md"
- "**/LICENSE.txt"
jobs:
build:
runs-on: self-hosted
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v3
- name: Setting env variables
run: |
touch .env
echo DATABASE_URL=${{ secrets.DATABASE_URL }} >> .env
echo SECRET_COOKIE_PASSWORD=${{ secrets.SECRET_COOKIE_PASSWORD }} >> .env
echo BASE_URL=${{ secrets.BASE_URL }} >> .env
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Installing dependencies
run: npm ci
- name: Installing sharp
run: npm i sharp
- name: Building a production version
run: npm run build
- name: Restarting the server
run: pm2 restart clothing-shop -s