Skip to content

Tydeliggjør test

Tydeliggjør test #778

Workflow file for this run

name: "Build and deploy lydia-api"
on: [ push ]
env:
"IMAGE": "ghcr.io/${{ github.repository }}:${{ github.sha }}"
jobs:
"build":
permissions:
packages: write
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:
permissions: {}
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:
permissions: {}
name: "Deploy app to dev"
needs: "build"
if: github.ref == 'refs/heads/næringsundergrupper'
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- name: "Deploy application to dev"
uses: "nais/deploy/actions/deploy@v1"
env:
"APIKEY": "${{ secrets.NAIS_DEPLOY_APIKEY }}"
"CLUSTER": "dev-gcp"
"RESOURCE": ".nais/nais.yaml"
"VARS": ".nais/dev.yaml"