Skip to content

Commit 688611d

Browse files
vermaliGitHub Actions
andauthored
Update workflows (#335)
* added maven_args to skip tests * [maven-release-plugin] prepare release dave-frontend-2.0.1 * [maven-release-plugin] prepare for next development iteration * Updated build_push_feature workflow * Update build_push_stable.yaml * Update build.yaml * Delete .github/workflows/snapshot_build.yaml * AD default.yml * skipped tests * skipped tests * Update build_push_stable.yaml --------- Co-authored-by: GitHub Actions <[email protected]>
1 parent f235a36 commit 688611d

File tree

10 files changed

+128
-172
lines changed

10 files changed

+128
-172
lines changed

.github/workflows/build.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ jobs:
1111
uses: actions/checkout@v3
1212

1313
- name: Advance Security Policy as Code
14-
uses: advanced-security/policy-as-code@v2.4.1
14+
uses: advanced-security/policy-as-code@v2.5.0
1515
with:
16-
policy: it-at-m/policy-as-code
17-
policy-path: default.yaml
18-
token: ${{ secrets.GITHUB_TOKEN }}
19-
argvs: "--disable-dependabot --disable-secret-scanning --disable-code-scanning --display"
16+
policy: GeekMasher/security-queries
17+
policy-path: $GITHUB_WORKSPACE/policies/default.yml
18+
19+
token: ${{ secrets.ACCESS_TOKEN }}
20+
21+
argvs: '--disable-dependabot --disable-secret-scanning --disable-code-scanning'
2022

2123
build-maven:
2224
needs: compliance
@@ -34,10 +36,10 @@ jobs:
3436
distribution: "temurin"
3537
cache: "maven"
3638

37-
- name: Set up Node 16
38-
uses: actions/setup-node@v3
39+
- name: Set up Node
40+
uses: actions/setup-node@v4
3941
with:
40-
node-version: 16
42+
node-version: 18
4143

4244
- name: Build with Maven
43-
run: mvn -B verify "-Dspring-boot.run.jvmArguments=-Dfile.encoding=UTF-8" -DskipTests=true
45+
run: mvn -B verify -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dmaven.test.skip

.github/workflows/build_feature.yaml

Lines changed: 0 additions & 46 deletions
This file was deleted.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Build feature branch
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'What should the image be tagged as?'
8+
required: false
9+
default: 'dev'
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_NAME: ${{ github.repository }}
13+
14+
jobs:
15+
build-and-push-image:
16+
runs-on: ubuntu-latest
17+
18+
permissions:
19+
contents: read
20+
packages: write
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Log in to the Container registry
27+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
28+
with:
29+
registry: ${{ env.REGISTRY }}
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Extract metadata (tags, labels) for Docker
34+
id: meta
35+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
36+
with:
37+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
38+
tags: |
39+
# use tag from input
40+
type=raw,value=${{ github.event.inputs.tag }},enable=true
41+
labels: |
42+
maintainer=it@m, Landeshauptstadt Muenchen (LHM)
43+
44+
- name: Install Java and Maven
45+
uses: actions/setup-java@v3
46+
with:
47+
java-version: "21"
48+
distribution: "temurin"
49+
cache: "maven"
50+
51+
- name: Set up Node
52+
uses: actions/setup-node@v4
53+
with:
54+
node-version: 18
55+
56+
- name: Build with Maven
57+
run: mvn -B verify -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dmaven.test.skip
58+
59+
- name: Build and push Docker image
60+
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
61+
with:
62+
context: .
63+
push: true
64+
tags: ${{ steps.meta.outputs.tags }}
65+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/build_push_ghcr.yaml renamed to .github/workflows/build_push_stable.yaml

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,14 @@ name: build image and push to ghcr.io
22

33
on:
44
push:
5-
branches: ["main-ls2", "sprint"]
5+
branches: ["main-ng", "sprint"]
66

77
env:
88
REGISTRY: ghcr.io
99
IMAGE_NAME: ${{ github.repository }}
1010

1111
jobs:
12-
compliance:
13-
runs-on: ubuntu-latest
14-
15-
steps:
16-
- name: Checkout code
17-
uses: actions/checkout@v3
18-
19-
- name: Advance Security Policy as Code
20-
uses: advanced-security/[email protected]
21-
with:
22-
policy: it-at-m/policy-as-code
23-
policy-path: default.yaml
24-
token: ${{ secrets.GITHUB_TOKEN }}
25-
argvs: "--disable-dependabot --disable-secret-scanning --disable-code-scanning --display"
26-
2712
build-and-push-image:
28-
needs: compliance
2913
runs-on: ubuntu-latest
3014

3115
permissions:
@@ -48,6 +32,11 @@ jobs:
4832
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
4933
with:
5034
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
35+
tags: |
36+
# set latest tag for sprint branch
37+
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'sprint') }}
38+
# set stable tag for main-ls2 branch
39+
type=raw,value=stable,enable=${{ github.ref == format('refs/heads/{0}', 'main-ng') }}
5140
labels: |
5241
maintainer=it@m, Landeshauptstadt Muenchen (LHM)
5342
@@ -58,13 +47,13 @@ jobs:
5847
distribution: "temurin"
5948
cache: "maven"
6049

61-
- name: Set up Node 16
62-
uses: actions/setup-node@v3
50+
- name: Set up Node
51+
uses: actions/setup-node@v4
6352
with:
64-
node-version: 16
53+
node-version: 18
6554

6655
- name: Build with Maven
67-
run: mvn -B verify "-Dspring-boot.run.jvmArguments=-Dfile.encoding=UTF-8" -DskipTests=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN
56+
run: mvn -B verify -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dmaven.test.skip
6857

6958
- name: Build and push Docker image
7059
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
@@ -73,3 +62,4 @@ jobs:
7362
push: true
7463
tags: ${{ steps.meta.outputs.tags }}
7564
labels: ${{ steps.meta.outputs.labels }}
65+

.github/workflows/release.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ jobs:
2020
ARTIFACT_NAME: ${{ steps.maven-release-step.outputs.artifact-name }}
2121
env:
2222
TZ: Europe/Berlin # timezone
23+
MAVEN_ARGS: -Dmaven.test.skip
2324
steps:
2425
- id: maven-release-step
25-
uses: it-at-m/.github/.github/actions/action-maven-release@main
26+
uses: it-at-m/lhm_actions/action-templates/actions/action-maven-release@v1.0.0
2627
with:
2728
app-path: ""
2829
releaseVersion: "${{ github.event.inputs.releaseVersion }}"
@@ -35,7 +36,7 @@ jobs:
3536
steps:
3637
- name: Create GitHub Release
3738
id: create_release
38-
uses: it-at-m/.github/.github/actions/action-create-github-release@main
39+
uses: it-at-m/lhm_actions/action-templates/actions/action-create-github-release@v1.0.0
3940
with:
4041
artifact-name: ${{ needs.release-maven.outputs.ARTIFACT_NAME }}
4142
tag-name: ${{ needs.release-maven.outputs.MVN_ARTIFACT_ID }}-${{ github.event.inputs.releaseVersion }}

.github/workflows/snapshot_build.yaml

Lines changed: 0 additions & 88 deletions
This file was deleted.

apigateway/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>de.muenchen.dave.apigateway</groupId>
77
<artifactId>dave-frontend-apigateway</artifactId>
8-
<version>1.17.1-SNAPSHOT</version>
8+
<version>2.0.2-SNAPSHOT</version>
99
<packaging>jar</packaging>
1010
<name>dave_frontend_apigateway</name>
1111

@@ -141,7 +141,7 @@
141141
<!-- Frontend Lib -->
142142
<dependency>
143143
<groupId>de.muenchen.dave.frontend</groupId>
144-
<version>1.17.1-SNAPSHOT</version>
144+
<version>2.0.2-SNAPSHOT</version>
145145
<artifactId>dave-frontend-frontend</artifactId>
146146
<scope>runtime</scope>
147147
</dependency>
@@ -216,8 +216,8 @@
216216
<eclipse>
217217
<file>itm-java-codeformat/java_codestyle_formatter.xml</file>
218218
</eclipse>
219-
<trimTrailingWhitespace/>
220-
<endWithNewline/>
219+
<trimTrailingWhitespace />
220+
<endWithNewline />
221221
</java>
222222
</configuration>
223223
<executions>

frontend/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>de.muenchen.dave.frontend</groupId>
77
<artifactId>dave-frontend-frontend</artifactId>
8-
<version>1.17.1-SNAPSHOT</version>
8+
<version>2.0.2-SNAPSHOT</version>
99
<packaging>jar</packaging>
1010
<name>dave_frontend_frontend</name>
1111

policies/default.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Default Policy
2+
3+
codescanning:
4+
level: error
5+
6+
# Dependency Security Alters
7+
dependabot:
8+
level: high
9+
10+
# Dependency Licensing Alerts
11+
licensing:
12+
conditions:
13+
ids:
14+
- GPL-*
15+
- LGPL-*
16+
- AGPL-*
17+
18+
warnings:
19+
# Warning is the dependency isn't known
20+
ids:
21+
- Other
22+
- NA
23+
24+
# General Dependency Alerts
25+
# dependencies:
26+
# warnings:
27+
# ids:
28+
# - Maintenance
29+
# - Organization
30+
31+
secretscanning:
32+
level: all

0 commit comments

Comments
 (0)