-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (50 loc) · 2.08 KB
/
ci.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: Node.js CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
env:
DB_HOST: ${{ secrets.DB_HOST }}
DB_USERNAME: ${{ secrets.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_DATABASE: ${{ secrets.DB_DATABASE }}
DB_PORT: ${{ secrets.DB_PORT }}
NODE_DOCKER_PORT: ${{ secrets.NODE_DOCKER_PORT }}
GMAIL_OAUTH_USER: ${{ secrets.GMAIL_OAUTH_USER }}
GMAIL_OAUTH_CLIENT_ID: ${{ secrets.GMAIL_OAUTH_CLIENT_ID }}
GMAIL_OAUTH_CLIENT_SECRET: ${{ secrets.GMAIL_OAUTH_CLIENT_SECRET }}
GMAIL_OAUTH_REFRESH_TOKEN: ${{ secrets.GMAIL_OAUTH_REFRESH_TOKEN }}
AWS_S3_SECRET_KEY: ${{ secrets.AWS_S3_SECRET_KEY }}
AWS_S3_ACCESS_KEY: ${{ secrets.AWS_S3_ACCESS_KEY }}
AWS_S3_REGION: ${{ secrets.AWS_S3_REGION }}
AWS_BUCKET: ${{ secrets.AWS_BUCKET }}
PEXELS_API_KEY: ${{ secrets.PEXELS_API_KEY }}
OPEN_AI_KEY: ${{ secrets.OPEN_AI_KEY }}
RABBITMQ_USER: ${{ secrets.RABBITMQ_USER }}
RABBITMQ_PASSWORD: ${{ secrets.RABBITMQ_PASSWORD }}
VITE_APP_GOOGLE_ANALYTICS: ${{ secrets.VITE_APP_GOOGLE_ANALYTICS }}
VITE_APP_BUCKET_NAME: ${{ secrets.VITE_APP_BUCKET_NAME }}
VITE_APP_SECRET_ACCESS_KEY_ID: ${{ secrets.VITE_APP_SECRET_ACCESS_KEY_ID }}
VITE_APP_ACCESS_KEY_ID: ${{ secrets.VITE_APP_ACCESS_KEY_ID }}
VITE_APP_REGION: ${{ secrets.VITE_APP_REGION }}
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- run: npm run build --if-present
- name: Docker build and push
run: |
echo ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
docker build -f ./backend/Dockerfile --platform linux/amd64 -t ssjojung/myrepo:${GITHUB_SHA::7} ./backend
docker push ssjojung/myrepo:${GITHUB_SHA::7}