Skip to content

Bytt alerting til PrometheusRule i prod #734

Bytt alerting til PrometheusRule i prod

Bytt alerting til PrometheusRule i prod #734

Workflow file for this run

name: "Build and deploy lydia-api"
on: [ push ]
env:
"IMAGE": "ghcr.io/${{ github.repository }}:${{ github.sha }}"
jobs:
"build":
name: "build"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- uses: "gradle/wrapper-validation-action@v1"
- uses: "actions/cache@v3"
with:
"path": "~/.gradle/caches"
"key": "${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}"
"restore-keys": "${{ runner.os }}-gradle-"
- uses: "actions/setup-java@v3"
with:
distribution: 'temurin'
java-version: '17'
- name: "Compile, run tests and build"
run: "./gradlew build --no-daemon"
- name: "Set up QEMU"
uses: "docker/setup-qemu-action@v2"
with:
platforms: "linux/amd64,linux/arm64"
- name: "Set up Docker Buildx"
uses: "docker/setup-buildx-action@v2"
- name: "Login to GitHub Docker Registry"
uses: "docker/login-action@v2"
with:
"registry": "ghcr.io"
"username": "${{ github.actor }}"
"password": "${{ secrets.GITHUB_TOKEN }}"
- name: "Build and push the Docker image"
uses: "docker/build-push-action@v3"
with:
context: .
platforms: "linux/amd64,linux/arm64"
push: true
tags: ghcr.io/${{ github.repository }}:latest,${{ env.IMAGE }}
deploy:
strategy:
matrix:
cluster: [dev, prod]
name: "Deploy app to ${{ matrix.cluster }}"
needs: "build"
if: github.ref == 'refs/heads/main'
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- name: "Deploy application to ${{ matrix.cluster }}"
uses: "nais/deploy/actions/deploy@v1"
env:
"APIKEY": "${{ secrets.NAIS_DEPLOY_APIKEY }}"
"CLUSTER": "${{ matrix.cluster }}-gcp"
"RESOURCE": ".nais/nais.yaml"
"VARS": ".nais/${{ matrix.cluster }}.yaml"
deploy-dev-branch:
strategy:
matrix:
cluster: [ dev ]
name: "Deploy app to ${{ matrix.cluster }}"
needs: "build"
if: github.ref == 'refs/heads/import-statistikk-naringskoder'
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- name: "Deploy application to ${{ matrix.cluster }}"
uses: "nais/deploy/actions/deploy@v1"
env:
"APIKEY": "${{ secrets.NAIS_DEPLOY_APIKEY }}"
"CLUSTER": "${{ matrix.cluster }}-gcp"
"RESOURCE": ".nais/nais.yaml"
"VARS": ".nais/${{ matrix.cluster }}.yaml"