Add readiness / liveness probes #31
Workflow file for this run
This file contains hidden or 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: Deploy | |
| on: | |
| push: | |
| tags: | |
| - "*" | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository_owner }}/self-monitor | |
| jobs: | |
| build-and-push-image: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| attestations: write | |
| id-token: write | |
| defaults: | |
| run: | |
| working-directory: ./self-monitor | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: "21" | |
| distribution: "temurin" | |
| cache: "gradle" | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build image with bootBuildImage | |
| run: ./gradlew bootBuildImage --imageName=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }} | |
| - name: Tag image as latest | |
| run: docker tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | |
| - name: Push Docker images | |
| run: | | |
| docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }} | |
| docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | |
| helm-upgrade: | |
| runs-on: ubuntu-latest | |
| needs: build-and-push-image | |
| defaults: | |
| run: | |
| working-directory: ./self-monitor | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Install kubectl | |
| uses: azure/setup-kubectl@v3 | |
| - name: Install Helm | |
| uses: azure/setup-helm@v3 | |
| - name: Set up kubeconfig | |
| env: | |
| KUBECONFIG_DATA: ${{ secrets.KUBECONFIG }} | |
| run: | | |
| echo "${KUBECONFIG_DATA}" > .kubeconfig | |
| - name: Helm upgrade Self Monitor | |
| env: | |
| KUBECONFIG: .kubeconfig | |
| run: | | |
| helm upgrade --install self-monitor ./charts/self-monitor \ | |
| --namespace api \ | |
| --set image.tag=${{ github.ref_name }} \ | |
| --set appVersion=${{ github.ref_name }} | |
| create-gh-release: | |
| runs-on: ubuntu-latest | |
| needs: helm-upgrade | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Create GitHub Release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| generateReleaseNotes: true |