-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
57de7d8
commit 433f2ed
Showing
1 changed file
with
6 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ env: | |
CLUSTER_NAME: blogs-analyzer-cluster | ||
REGION: ${{ secrets.GKE_ZONE }} | ||
REGISTRY_NAME: blogs-analyzer | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
|
||
jobs: | ||
build: | ||
|
@@ -80,14 +81,14 @@ jobs: | |
- name: Setup Google Cloud SDK | ||
uses: google-github-actions/[email protected] | ||
with: | ||
project_id: ${{ secrets.GKE_PROJECT }} | ||
service_account_key: ${{ secrets.SERVICE_ACCOUNT_KEY }} | ||
project_id: ${{ env.GKE_PROJECT }} | ||
service_account_key: ${{ env.SERVICE_ACCOUNT_KEY }} | ||
|
||
- name: Authenticate to Google Cloud | ||
id: auth | ||
uses: google-github-actions/[email protected] | ||
with: | ||
credentials_json: ${{ secrets.SERVICE_ACCOUNT_KEY }} | ||
credentials_json: ${{ env.SERVICE_ACCOUNT_KEY }} | ||
|
||
- name: Configure Docker for Google Container Registry | ||
run: gcloud auth configure-docker | ||
|
@@ -100,7 +101,7 @@ jobs: | |
echo "Building and pushing Docker image for $SERVICE_NAME" | ||
if [ -d "$SERVICE_NAME" ]; then | ||
cd $SERVICE_NAME | ||
IMAGE_NAME=gcr.io/gen-lang-client-0999974873/$SERVICE_NAME:latest | ||
IMAGE_NAME=gcr.io/${{ env.GKE_PROJECT }}/$SERVICE_NAME:latest | ||
docker build -t $IMAGE_NAME . | ||
docker push $IMAGE_NAME | ||
cd .. | ||
|
@@ -109,7 +110,7 @@ jobs: | |
- name: Deploy to GKE | ||
run: | | ||
gcloud container clusters get-credentials ${{ secrets.CLUSTER_NAME }} --zone ${{ secrets.GKE_ZONE }} | ||
gcloud container clusters get-credentials ${{ env.CLUSTER_NAME }} --zone ${{ env.GKE_ZONE }} | ||
SERVICE_NAMES=$(cat projects-changes-deploy.txt) | ||
echo "Service Names: $SERVICE_NAMES" | ||
for SERVICE_NAME in $(echo $SERVICE_NAMES | tr ',' ' '); do | ||
|
@@ -160,8 +161,6 @@ jobs: | |
cd .. | ||
fi | ||
done | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
# Sonar Analysis for Angular projects | ||
- name: Sonar Analysis for Angular projects | ||
|
@@ -181,5 +180,3 @@ jobs: | |
cd .. | ||
fi | ||
done | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |