Skip to content

Commit b2a56c7

Browse files
committed
test manual workflow
1 parent c1959ae commit b2a56c7

File tree

1 file changed

+82
-1
lines changed

1 file changed

+82
-1
lines changed

.github/workflows/klass-dev.yaml

Lines changed: 82 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,97 @@ name: Klass dev
33
on:
44
workflow_dispatch:
55
inputs:
6+
ttl:
7+
description: "How long?"
8+
options:
9+
- 1h
10+
- 2h
611
message:
712
description: "Which message?"
813
required: true
914
type: choice
1015
options:
1116
- "My name"
1217
- "Your name"
18+
push:
1319

1420
jobs:
1521
test:
1622
runs-on: ubuntu-latest
1723
steps:
18-
- run: echo ${{github.event.inputs.message}}
24+
- run: echo ${{ github.event.inputs.message }}
25+
- run: echo ${{ github.event.inputs.ttl }}
26+
27+
build:
28+
name: Build
29+
permissions:
30+
contents: "read"
31+
id-token: "write"
32+
packages: "read"
33+
runs-on: ubuntu-latest
34+
outputs:
35+
image: ${{ steps.docker-build-push.outputs.image }}
36+
telemetry: ${{ steps.docker-build-push.outputs.telemetry }}
37+
test-config-changed: ${{ steps.test-config-changed.outputs.changed != 'non-inputs' }}
38+
only-config-changed: ${{ steps.changed-files.outputs.changed == 'only-inputs'}}
39+
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v4
43+
with:
44+
fetch-depth: 0
45+
- uses: actions/setup-java@v4
46+
with:
47+
distribution: 'temurin'
48+
java-version: '17'
49+
cache: 'maven'
50+
51+
- name: Check what changed
52+
id: changed-files
53+
uses: "nais/what-changed@main"
54+
with:
55+
files: .nais/**/klass-api-pr.yaml
56+
main-branch-name: 'nais-migration' #TODO: Remove when we change branch back to main
57+
- name: Check for test config changes
58+
id: test-config-changed
59+
uses: "nais/what-changed@main"
60+
with:
61+
files: .nais/test/klass-api-pr.yaml
62+
main-branch-name: 'nais-migration' #TODO: Remove when we change branch back to main
63+
64+
- name: Build with Maven
65+
if: steps.changed-files.outputs.changed != 'only-inputs'
66+
run: mvn --batch-mode --update-snapshots install -pl '!:klass-forvaltning'
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
70+
- name: Build and push
71+
if: steps.changed-files.outputs.changed != 'only-inputs'
72+
uses: nais/docker-build-push@v0
73+
id: docker-build-push
74+
with:
75+
team: dapla-metadata
76+
image_suffix: api
77+
dockerfile: klass-api/Dockerfile
78+
docker_context: klass-api
79+
80+
deploy-test:
81+
name: Deploy to test
82+
needs: build
83+
permissions:
84+
contents: "read"
85+
id-token: "write"
86+
packages: "read"
87+
runs-on: ubuntu-latest
88+
steps:
89+
- name: Checkout
90+
uses: actions/checkout@v4
91+
92+
- uses: nais/deploy/actions/deploy@v2
93+
env:
94+
CLUSTER: test
95+
RESOURCE: .nais/test/klass-api-dev.yaml
96+
DEPLOY_SERVER: deploy.ssb.cloud.nais.io:443
97+
WORKLOAD_IMAGE: ${{ needs.build.outputs.image }}
98+
TTL: ${{ github.event.inputs.ttl }}
99+
TELEMETRY: ${{ needs.build.outputs.telemetry }}

0 commit comments

Comments
 (0)