add infra and deployment scripts #4
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' | |
jobs: | |
build-and-push: | |
name: Build and push 🏗️ | |
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 | |
- 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: Deploy services | |
uses: 'deliverybot/helm@v1' | |
run: ./helm_upgrade.sh ${{ steps.vars.outputs.sha_short }} | |
- run: echo "🍏 Job's status is ${{ job.status }}." |