-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.11 KB
/
cicd.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
name: CICD
on:
push:
branches: [develop]
pull_request:
branches: [develop]
jobs:
ci:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Copy repository
uses: actions/checkout@v4
- name: Create empty .env files
run: |
echo "${{ secrets.ENV_FILE }}" > ./.env
touch ./server/.env
touch ./client/.env
- name: Set up Docker Compose
run: docker compose build
- name: Server lint
run: docker compose run server npm run lint:dryrun
- name: Client lint
run: docker compose run client npm run lint
cd:
runs-on: ubuntu-latest
needs: ci
# ssh to server and run commands
steps:
- name: SSH and Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd ~/project/develop &&
git checkout develop &&
git pull origin &&
docker compose up --build -d