tkeburia building and deploying microservices 🚀 #13
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
name: Build and Deploy Microservices | |
run-name: ${{ github.actor }} building and deploying microservices 🚀 | |
on: | |
push: | |
branches: | |
- 'main' | |
env: | |
USE_GKE_GCLOUD_AUTH_PLUGIN: True | |
jobs: | |
build-and-push: | |
name: Build, push and deploy 🏗️🚀 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." | |
- name: Authenticate with GCR | |
run: | | |
echo ${{ secrets.GCR_KEY }} | base64 --decode > gcr-key.json | |
gcloud auth activate-service-account --key-file=gcr-key.json | |
gcloud auth configure-docker | |
gcloud components list | |
gcloud components install gke-gcloud-auth-plugin | |
gcloud container clusters get-credentials platform-poc-407113-cluster --location europe-west2 --project platform-poc-407113 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Set short sha | |
id: vars | |
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Run Maven package and push images | |
run: mvn clean package -Djib.to.tags=${{ steps.vars.outputs.sha_short }} | |
- name: Use Helm | |
uses: azure/setup-helm@v1 | |
with: | |
version: 'v3.13.2' | |
- name: run helm upgrade | |
run: ./helm_upgrade.sh ${{ steps.vars.outputs.sha_short }} | |
- run: echo "🍏 Job's status is ${{ job.status }}." |