-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (40 loc) · 1.3 KB
/
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
name: Deploy til preprod
on: [workflow_dispatch]
env:
BASE_IMAGE: ghcr.io/${{ github.repository }}
jobs:
Build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
cache: gradle
- name: Kjør tester & bygg JAR
run: ./gradlew test shadowjar
env:
GITHUB_TOKEN: ${{ secrets.READER_TOKEN }}
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.REPOSITORY_OWNER }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Sett tag for docker image
run: echo "TAG=$(date "+%Y.%m.%d")-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Bygg & last opp Docker image
run: |
docker build --pull --tag ${BASE_IMAGE}:${TAG} --tag ${BASE_IMAGE}:latest .
docker push ${BASE_IMAGE} --all-tags
- name: Sett image for nais deploy
run: echo "IMAGE=${BASE_IMAGE}:${TAG}" >> $GITHUB_ENV
- name: Deploy til preprod
uses: nais/deploy/actions/deploy@v2
env:
APIKEY: ${{ secrets.DEPLOY_KEY }}
CLUSTER: dev-fss
RESOURCE: nais/dev-fss.yml