Dependabot/maven/org.apache.maven.plugins maven surefire plugin 2.22.… #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release to Dockerhub | |
on: | |
push: | |
branches: [master, dev] | |
paths-ignore: | |
- '**.md' | |
- '.github/' | |
- '.gitignore' | |
- '.sonarcloud.properties' | |
- 'provisioning' | |
- 'CONTRIBUTING.md' | |
- 'LICENSE' | |
- 'README.md' | |
- 'Vagrantfile' | |
jobs: | |
build: | |
if: github.event_name != 'pull_request' && github.repository == 'OWASP/SecurityShepherd' | |
name: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 1.8 | |
uses: actions/[email protected] | |
with: | |
distribution: 'zulu' | |
java-version: '8' | |
- name: Build Maven with Docker Profile and Generate SBOM | |
run: mvn clean install -Pdocker -DskipTests -B -DexcludeTestProject=true cyclonedx:makeBom | |
- name: Upload WAR File | |
uses: actions/upload-artifact@v3 | |
with: | |
name: security_shepherd_war | |
path: target/*.war | |
- name: Docker Compose Build | |
run: docker-compose build | |
- name: Generate Tomcat Docker Image SBOM | |
uses: anchore/sbom-action@v0 | |
id: tomcat | |
with: | |
format: cyclonedx-json | |
image: owasp/security-shepherd | |
output-file: ${{ github.workspace }}/target/owasp-security-shepherd-tomcat.cyclonedx.json | |
- name: Generate MariaDB Docker Image SBOM | |
uses: anchore/sbom-action@v0 | |
id: mariadb | |
with: | |
format: cyclonedx-json | |
image: owasp/security-shepherd_mariadb | |
output-file: ${{ github.workspace }}/target/owasp-security-shepherd-mariadb.cyclonedx.json | |
- name: Generate MongoDB Docker Image SBOM | |
uses: anchore/sbom-action@v0 | |
id: mongodb | |
with: | |
format: cyclonedx-json | |
image: owasp/security-shepherd_mongo | |
output-file: ${{ github.workspace }}/target/owasp-security-shepherd-mongodb.cyclonedx.json | |
- name: Upload SBOMs | |
uses: actions/upload-artifact@v3 | |
with: | |
name: security_shepherd_sboms | |
path: | | |
target/*.json | |
target/*.xml | |
- name: Cache Maven packages | |
uses: actions/cache@v3 | |
with: | |
key: maven-output-${{ hashFiles('target/**') }} | |
path: | | |
target/ | |
docker/mariadb/target | |
docker/mongo/target | |
release-security-shepherd: | |
needs: build | |
if: github.event_name != 'pull_request' && github.repository == 'OWASP/SecurityShepherd' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Log in to Docker Hub | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/[email protected] | |
with: | |
images: owasp/security-shepherd | |
- name: Restore Cached Maven packages | |
uses: actions/cache@v3 | |
with: | |
key: maven-output-${{ hashFiles('target/**') }} | |
path: | | |
target/ | |
docker/mariadb/target | |
docker/mongo/target | |
# Dump the environment variables from the dotenv file so they can be used to build the tomcat server | |
- name: Set environment variables | |
uses: c-py/action-dotenv-to-setenv@80f488cda311f44d43e687a4e94f54a050b7822a # v4 | |
with: | |
env-file: .env | |
- name: Build and push Tomcat | |
uses: docker/[email protected] | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: | | |
TOMCAT_DOCKER_VERSION | |
TLS_KEYSTORE_FILE | |
TLS_KEYSTORE_PASS | |
ALIAS | |
HTTPS_PORT |