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: Continuous Integration for Comment Service | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
jobs: | ||
testing: | ||
name: Testing Comment Service | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Setup JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'corretto' | ||
java-version: 17 | ||
- name: Set up MongoDB URI | ||
run: echo "SPRING_DATA_MONGODB_URI=mongodb://localhost:27017/user-service" >> $GITHUB_ENV | ||
- name: Unit Tests | ||
run: mvn -B test --file pom.xml | ||
deploy: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Setup Helm | ||
uses: azure/setup-helm@v1 | ||
- name: Deploy to Kubernetes | ||
run: | | ||
helm repo add bitnami https://charts.bitnami.com/bitnami | ||
helm upgrade --install my-mongo bitnami/mongodb | ||
helm upgrade --install user-service ./user-service --set image.repository=your-docker-repo/user-service,image.tag=latest |