-
Notifications
You must be signed in to change notification settings - Fork 5
58 lines (48 loc) · 1.67 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
57
58
name: CI Pipeline
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'npm'
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: '6.0'
- name: Install dependencies
working-directory: backend/question-service
run: npm ci
- name: Run Tests
working-directory: backend/question-service
run: npm run test-ci
- name: Google Cloud Authentication
uses: "google-github-actions/auth@v1"
with:
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
project_id: tokyo-crossbar-440806-u9
service_account_key: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
export_defauly_credentials: true
- name: Configure Docker for Google Artifact Registry
run: |
gcloud auth configure-docker asia-southeast1-docker.pkg.dev
- name: Build and push Docker images
run: |
docker compose build
services=("frontend" "matching-service" "question" "signaling-service" "user")
for service in "${services[@]}"; do
image="asia-southeast1-docker.pkg.dev/tokyo-crossbar-440806-u9/peerprep/$service:latest"
docker tag "cs3219-ay2425s1-project-g44-$service" "$image"
docker push "$image"
done