forked from AltCamp/altcampv1-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (45 loc) · 1.35 KB
/
deploy.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
47
48
49
50
51
52
53
54
55
56
name: Deployment pipeline
on:
push:
branches: [main]
jobs:
pre_build_run:
runs-on: ubuntu-20.04
environment:
name: Pre-deployment
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install dependencies
run: npm install
- name: Check code style
run: npm run format:check
- name: Lint code base
run: npm run lint
- name: Run tests
env:
TEST_CLOUDINARY_CLOUD_NAME: ${{ secrets.TEST_CLOUDINARY_CLOUD_NAME }}
TEST_CLOUDINARY_API_KEY: ${{ secrets.TEST_CLOUDINARY_API_KEY }}
TEST_CLOUDINARY_API_SECRET: ${{ secrets.TEST_CLOUDINARY_API_SECRET }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
JWT_EXPIRY: ${{ secrets.JWT_EXPIRY }}
run: npm run test
build:
needs: pre_build_run
runs-on: self-hosted
environment:
name: Pre-deployment
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
- name: Decrypt files
run: |
gpg --decrypt --quiet --batch --passphrase="$PASSPHRASE" --pinentry-mode loopback --output .env .locke.gpg
env:
PASSPHRASE: ${{ secrets.PASSPHRASE }}
- name: Install dependencies
run: npm install --omit=dev