Skip to content

Build-Deploy-Preprod #241

Build-Deploy-Preprod

Build-Deploy-Preprod #241

Workflow file for this run

name: Build-Deploy-Preprod
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
env:
IMAGE: ghcr.io/navikt/${{ github.repository }}:${{ github.sha }}
jobs:
build:
name: Bygg app/image, push til github, deploy til prod-fss og dev-fss
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
outputs:
image: ${{ steps.docker-build-push.outputs.image }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'gradle'
- name: Test and build
env:
GPR_API_KEY: ${{ secrets.GITHUB_TOKEN }}
run: |
./gradlew wrapper --gradle-version=8.5
./gradlew test build --no-daemon
- uses: nais/docker-build-push@v0
id: docker-push
with:
team: teamfamilie
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
deploy-to-dev:
name: Deploy to FSS
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Deploy til dev-fss
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-fss
RESOURCE: nais/dev-fss.yml
IMAGE: ${{ needs.build.outputs.image }}