Skip to content

Commit

Permalink
Update backend cicd workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
evanyan13 committed Nov 12, 2024
1 parent 9efe6b8 commit c7f9e0a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/backend-ci-workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Backend CI Workflow

on:
on:
pull_request:
branches:
- main
Expand All @@ -22,32 +22,32 @@ jobs:

- name: Install Dependencies for Each Service
run: |
cd backend
for service in auth-service question-service user-service matching-service gateway-service collaboration-service; do
services=("auth-service" "code-execution-service" "collaboration-service" "gateway-service" "matching-service" "question-service" "user-service" "y-websocket-service")
for service in "${services[@]}"; do
echo "Installing dependencies for $service"
cd $service
cd backend/$service
npm install
cd ..
cd ../..
done
# Build Check for Each Service
- name: Build Each Service
run: |
cd backend
for service in auth-service question-service user-service matching-service gateway-service collaboration-service; do
services=("auth-service" "code-execution-service" "collaboration-service" "gateway-service" "matching-service" "question-service" "user-service" "y-websocket-service")
for service in "${services[@]}"; do
echo "Building $service"
cd $service
cd backend/$service
npm run build
cd ..
cd ../..
done
# Lint Check for Each Service
- name: Lint Each Service
run: |
cd backend
for service in auth-service question-service user-service matching-service gateway-service collaboration-service; do
services=("auth-service" "code-execution-service" "collaboration-service" "gateway-service" "matching-service" "question-service" "user-service" "y-websocket-service")
for service in "${services[@]}"; do
echo "Linting $service"
cd $service
cd backend/$service
npm run lint
cd ..
cd ../..
done
5 changes: 2 additions & 3 deletions .github/workflows/docker-build-push-gcloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ jobs:
env:
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
GCP_REGION: ${{ secrets.GCP_REGION }}
SERVICES: ${{ vars.SERVICES }}
run: |
# Convert the comma-separated SERVICES string to an array
IFS=',' read -ra services <<< "$SERVICES"
# Define an array with the names of your services
services=("auth-service" "code-execution-service" "collaboration-service" "gateway-service" "matching-service" "question-service" "user-service" "y-websocket-service")
# Loop over each service, build and push its Docker image
for service in "${services[@]}"; do
Expand Down

0 comments on commit c7f9e0a

Please sign in to comment.