-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (54 loc) · 1.63 KB
/
build-and-deploy-preprod.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
47
48
49
50
51
52
53
54
55
name: Build-Deploy-Preprod
on:
push:
branches-ignore:
- 'main'
workflow_dispatch:
env:
IMAGE: ghcr.io/navikt/familie-oppdrag:${{ github.sha }}
jobs:
build:
name: Bygg app/image, push til github
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: 'maven'
- name: Bygg med maven
env:
GITHUB_USERNAME: x-access-token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn -B --no-transfer-progress package verify --settings .m2/maven-settings.xml --file pom.xml
- name: Bygg Docker image
run: |
docker build -t $IMAGE .
- name: Login to GitHub Container Registry
if: github.triggering_actor != 'dependabot[bot]'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push Docker image
if: github.triggering_actor != 'dependabot[bot]'
run: docker push $IMAGE
deploy:
name: Deploy to FSS
if: github.triggering_actor != 'dependabot[bot]'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy til dev-fss team namespace
uses: nais/deploy/actions/deploy@v2
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-fss
RESOURCE: app-preprod.yaml