build(deps-dev): bump com.diffplug.spotless:spotless-maven-plugin (#884) #163
This file contains hidden or 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - 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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| 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@e22c389904149dbc22b58101806040fa8d37a610 # v0.24.0 | |
| 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@e22c389904149dbc22b58101806040fa8d37a610 # v0.24.0 | |
| 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@e22c389904149dbc22b58101806040fa8d37a610 # v0.24.0 | |
| 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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: security_shepherd_sboms | |
| path: | | |
| target/*.json | |
| target/*.xml | |
| - name: Cache Maven packages | |
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6.1.0 | |
| with: | |
| images: owasp/security-shepherd | |
| - name: Restore Cached Maven packages | |
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| 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@925b5d99a3f1e4bd7b4e9928be4e2491e29891d9 # v5 | |
| with: | |
| env-file: .env | |
| - name: Build and push Tomcat | |
| uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0 | |
| 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 |