Skip to content

Commit

Permalink
La til deploy til dev for formidlingsgruppe-utgang
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsmsa committed May 28, 2024
1 parent ddb07a2 commit d420ca5
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/utgang-formidlingsgruppe-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Formidlingsgruppe - Utgang

on:
push:
branches:
- main
paths:
- 'apps/utgang-formidlingsgruppe/**'
- 'lib/kafka-key-generator-client/**'
- 'domain/main-avro-schema/**'
- '.github/workflows/utgang-formidlingsgruppe-deploy.yaml'
- 'gradle/**'
- 'settings.gradle.kts'
- 'gradle.properties'
- 'gradlew'

env:
IMAGE: europe-north1-docker.pkg.dev/${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}/paw/paw-arbeidssoekerregisteret-utgang-formidlingsgruppe
jobs:
build:
name: Build and push Docker container
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
outputs:
image: ${{ steps.docker-build-push.outputs.image }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 21
distribution: temurin
cache: gradle
- name: set module to build
run: echo "MODULE=utgang-formidlingsgruppe" >> $GITHUB_ENV
- name: Set version
run: echo "VERSION=$(date +'%y.%m.%d').${{ github.run_number }}-${{ github.run_attempt }}" >> $GITHUB_ENV
- name: Login GAR
uses: nais/login@v0
with:
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
team: paw
- name: Build and push image
id: docker-build-push
working-directory: ./
run: |
echo "image=${{ env.IMAGE }}:${{ env.VERSION }}" >> $GITHUB_OUTPUT
echo -Pversion=${{ env.VERSION }} -Pimage=${{ env.IMAGE }} ${{ env.MODULE }}:build ${{ env.MODULE }}:test ${{ env.MODULE }}:jib
./gradlew -Pversion=${{ env.VERSION }} -Pimage=${{ env.IMAGE }} ${{ env.MODULE }}:build ${{ env.MODULE }}:test ${{ env.MODULE }}:jib
echo "DIGEST=$(cat ${{ env.MODULE }}/build/jib-image.digest)" >> $GITHUB_ENV
env:
ORG_GRADLE_PROJECT_githubPassword: ${{ secrets.GITHUB_TOKEN }}
- name: Attest and sign
uses: nais/[email protected]
with:
image_ref: ${{ env.IMAGE }}@${{ env.DIGEST }}
deploy-dev:
name: Deploy to dev-gcp
permissions:
contents: read
id-token: write
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
RESOURCE: apps/utgang-formidlingsgruppe/nais/nais-dev.yaml
VAR: image=${{ needs.build.outputs.image }},kafka=nav-dev

0 comments on commit d420ca5

Please sign in to comment.