-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) · 1.25 KB
/
backend.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: Backend deploy
on:
push:
branches:
- main
- chore/fix-ci
paths:
- '.github/**'
- 'apps/backend/**'
permissions:
contents: read
id-token: write
jobs:
build:
runs-on: self-hosted
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 8
run_install: false
- name: Use Node.js version from .nvmrc
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Create Env File
run: |
touch ./apps/backend/.env
echo COUCHDB_PASSWORD=${{secrets.COUCHDB_PASSWORD}} >> ./apps/backend/.env
echo COUCHDB_USER=${{secrets.COUCHDB_USER}} >> ./apps/backend/.env
- name: Build
run: pnpm build --filter backend
- name: Build and Deploy Docker
working-directory: ./apps/backend
env:
COUCHDB_USER: ${{secrets.COUCHDB_USER}}
COUCHDB_PASSWORD: ${{secrets.COUCHDB_PASSWORD}}
run: |
chmod +x ./scripts/cicd.sh
./scripts/cicd.sh