Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratap2018 committed Jan 5, 2024
1 parent dcb77b8 commit c36311b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .deploy/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
spec:
containers:
- name: auth-server
image: __GOOGLE_ARTIFACT_URL__/__GOOGLE_PROJECT_ID__/__GOOGLE_ARTIFACT_REPO__/auth-server:2
image: __GOOGLE_ARTIFACT_URL__/__GOOGLE_PROJECT_ID__/__GOOGLE_ARTIFACT_REPO__/auth-server:__LATEST_RELEASE_TAG__
imagePullPolicy: Always
volumeMounts:
- mountPath: "/data"
Expand Down Expand Up @@ -112,7 +112,7 @@ spec:
spec:
containers:
- name: auth-server-txn
image: __GOOGLE_ARTIFACT_URL__/__GOOGLE_PROJECT_ID__/__GOOGLE_ARTIFACT_REPO__/auth-server-txn:2
image: __GOOGLE_ARTIFACT_URL__/__GOOGLE_PROJECT_ID__/__GOOGLE_ARTIFACT_REPO__/auth-server-txn:__LATEST_RELEASE_TAG__
imagePullPolicy: Always

volumeMounts:
Expand Down
22 changes: 16 additions & 6 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name: AuthServer Build and deploy Pipeline

on:
push:
branches:
- "master"
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]-rc.[0-9]+"

jobs:
Build-Pipeline:
Expand All @@ -12,6 +13,8 @@ jobs:
steps:
- name: code checkout
uses: actions/checkout@v3
- name: Set Latest Tag
run: echo "LATEST_RELEASE_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV

- id: "auth"
uses: "google-github-actions/auth@v1"
Expand Down Expand Up @@ -39,13 +42,13 @@ jobs:
GOOGLE_ARTIFACT_REPO: ${{secrets.GOOGLE_ARTIFACT_REPO}}
HYPERSIGN_JSON: ${{secrets.HYPERSIGN_JSON}}
run:
docker build -t $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/auth-server:2 .
docker build -t $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/auth-server:${{ env.LATEST_RELEASE_TAG }} .

docker push $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/auth-server:2
docker push $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/auth-server:${{ env.LATEST_RELEASE_TAG }}

docker build -t $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/auth-server-txn:2 . -f Txn.Dockerfile
docker build -t $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/auth-server-txn:${{ env.LATEST_RELEASE_TAG }} . -f Txn.Dockerfile

docker push $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/auth-server-txn:2
docker push $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/auth-server-txn:${{ env.LATEST_RELEASE_TAG }}

Deploy-Pipeline:
needs: [Build-Pipeline]
Expand All @@ -54,6 +57,10 @@ jobs:
steps:
- name: code checkout
uses: actions/checkout@v3

- name: Set Latest Tag
run: echo "LATEST_RELEASE_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV

- id: "auth"
uses: "google-github-actions/auth@v1"
with:
Expand All @@ -67,6 +74,9 @@ jobs:
export_default_credentials: true
- name: "Configure kubectl"
run: gcloud container clusters get-credentials hypermine-gke --region=asia-south1
- name: Replace tags
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__LATEST_RELEASE_TAG__#${{ env.LATEST_RELEASE_TAG }}#" {} \;

- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__GOOGLE_ARTIFACT_URL__/${{ secrets.GOOGLE_ARTIFACT_URL }}/g'' {} \;
- name: "Replace secrets"
Expand Down

0 comments on commit c36311b

Please sign in to comment.