-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (45 loc) · 1.31 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Build-Deploy-Prod
on:
push:
branches:
- main
-
permissions:
packages: write
contents: read
id-token: write
env:
IMAGE: ghcr.io/navikt/familie-ba-infotrygd:${{ github.sha }}
IMAGE_LATEST: ghcr.io/navikt/familie-ba-infotrygd:latest
jobs:
deploy-to-prod:
name: Bygg app/image, push til github, deploy til prod-fss og dev-fss
runs-on: ubuntu-latest
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 test build cyclonedxBom
- uses: nais/docker-build-push@v0
id: docker-push
with:
team: teamfamilie
push_image: true
tag: latest
dockerfile: Dockerfile
docker_context: .
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
byosbom: build/reports/application.cdx.json
- name: Deploy to prod-fss
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: prod-fss
RESOURCE: nais/prod-fss.yml
VAR: image=${{ steps.docker-push.outputs.image }}