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 17b2b2f commit 2502bde
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
2 changes: 1 addition & 1 deletion deployment.yaml → .deploy/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
spec:
containers:
- name: wallet-prajna
image: pratapmridha/wallet:2
image: pratapmridha/wallet:__LATEST_RELEASE_TAG__
resources:
limits:
memory: "256Mi"
Expand Down
33 changes: 31 additions & 2 deletions .github/workflows/wallet-pipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- "v[0-9]+.[0-9]+.[0-9]-rc.[0-9]+"

jobs:
Build-Pipeline:
Build:
runs-on: ubuntu-latest
environment: production
steps:
Expand Down Expand Up @@ -38,4 +38,33 @@ jobs:
GOOGLE_PROJECT_ID: ${{secrets.GOOGLE_PROJECT_ID}}
GOOGLE_ARTIFACT_URL: ${{secrets.GOOGLE_ARTIFACT_URL}}
GOOGLE_ARTIFACT_REPO: ${{secrets.GOOGLE_ARTIFACT_REPO}}
run: docker build -t $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/wallet:${{ env.LATEST_RELEASE_TAG }} .
run:
docker build -t $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/wallet:${{ env.LATEST_RELEASE_TAG }} /dist/web
docker push $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/wallet:${{ env.LATEST_RELEASE_TAG }}
Deploy:
needs: [Build]
runs-on: ubuntu-latest
environment: production
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:
credentials_json: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}"
- name: install gcloud cli tools
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{secrets.GOOGLE_PROJECT_ID}}
service_account_key: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}}
install_components: "gke-gcloud-auth-plugin"
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: "Deploy to GKE"
run: kubectl apply -f .deploy/deployment.yaml

0 comments on commit 2502bde

Please sign in to comment.