-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (48 loc) · 2.27 KB
/
maven.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
name: Security Module CI/CD
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "temurin"
cache: maven
- name: Build with Maven
run: mvn -B verify --file pom.xml
publish_opensmartclide_security_module_image:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "temurin"
cache: maven
- name: Build with Maven
run: mvn -B package -DskipTests --file pom.xml
- name: Publish Docker Images
run: |
# login to GitHub Container Registry
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${GITHUB_ACTOR} --password-stdin
# build images
docker build -t ghcr.io/eclipse-opensmartclide/opensmartclide/ssas:$(date +'%Y-%m-%d') -t ghcr.io/eclipse-opensmartclide/opensmartclide/ssas:latest .
docker build -t ghcr.io/eclipse-opensmartclide/opensmartclide/vam:$(date +'%Y-%m-%d') -t ghcr.io/eclipse-opensmartclide/opensmartclide/vam:latest -f VulnerabilityAssessmentModels/Dockerfile ./VulnerabilityAssessmentModels
docker build -t ghcr.io/eclipse-opensmartclide/opensmartclide/sonarqube-security-opensmartclide:$(date +'%Y-%m-%d') -t ghcr.io/eclipse-opensmartclide/opensmartclide/sonarqube-security-opensmartclide:latest -f sonarqube/Dockerfile ./sonarqube
# push images
docker push ghcr.io/eclipse-opensmartclide/opensmartclide/ssas:$(date +'%Y-%m-%d')
docker push ghcr.io/eclipse-opensmartclide/opensmartclide/ssas:latest
docker push ghcr.io/eclipse-opensmartclide/opensmartclide/vam:$(date +'%Y-%m-%d')
docker push ghcr.io/eclipse-opensmartclide/opensmartclide/vam:latest
docker push ghcr.io/eclipse-opensmartclide/opensmartclide/sonarqube-security-opensmartclide:$(date +'%Y-%m-%d')
docker push ghcr.io/eclipse-opensmartclide/opensmartclide/sonarqube-security-opensmartclide:latest