diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 248395aa1..71b1bf8c1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,7 +5,7 @@ on: branches: [main] workflow_dispatch: schedule: - - cron: "0 7 * * *" + - cron: "0 6 * * *" permissions: contents: write @@ -14,7 +14,6 @@ permissions: jobs: build: - if: github.repository == 'devsecopsmaturitymodel/DevSecOps-MaturityModel' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -28,7 +27,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Get Semantic Release Version id: get-version - run: echo "::set-output name=version::$(grep -oP '\[\d+\.\d+\.\d+\]' CHANGELOG.md | tr -d '[]')" + run: | + echo "::set-output name=version::$(grep -oP '\[\d+\.\d+\.\d+\]' CHANGELOG.md | tr -d '[]')" - name: show version run: | @@ -46,54 +46,26 @@ jobs: #registry: registry.hub.docker.com username: wurstbrot password: ${{ secrets.HUB_TOKEN }} - - name: create and push dsomm image + - name: create and push yaml image uses: docker/build-push-action@v3 with: push: true + file: Dockerfile platforms: linux/amd64,linux/arm64 - tags: wurstbrot/dsomm:${{ steps.get-version.outputs.version }},wurstbrot/dsomm:latest - build-args: | - COMMIT_HASH=${{ github.sha }} - COMMIT_DATE=${{ github.event.head_commit.timestamp }} - GIT_BRANCH=${{ github.ref_name }} - # Commit all changed files back to the repository - - uses: planetscale/ghcommit-action@v0.1.6 + tags: wurstbrot/dsomm-yaml-generation:${{ steps.get-version.outputs.version }},wurstbrot/dsomm-yaml-generation:latest + - name: Extract generated files from docker image + run: | + docker run -d --name=yaml --entrypoint="/bin/sleep" wurstbrot/dsomm-yaml-generation:${{ steps.get-version.outputs.version }} 60 + docker cp yaml:/var/www/html/generated/model.yaml generated/model.yaml + docker cp yaml:/var/www/html/generated/dependency-tree.md generated/dependency-tree.md + - name: Replace version placeholder in model.yaml + run: | + sed -i "s/__VERSION_PLACEHOLDER__/${{ steps.get-version.outputs.version }}/g" src/assets/YAML/model.yaml + - name: Commit all changed files back to the repository + uses: planetscale/ghcommit-action@v0.1.6 with: commit_message: "🤖 fmt" repo: ${{ github.repository }} branch: ${{ github.head_ref || github.ref_name }} env: GITHUB_TOKEN: ${{secrets.ACCESS_TOKEN}} - heroku: - if: github.repository == 'devsecopsmaturitymodel/DevSecOps-MaturityModel' && github.event_name == 'push' && github.ref == 'refs/heads/main' - runs-on: ubuntu-latest - steps: - - name: "Check out Git repository" - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0 - - name: "Set Heroku app & branch for ${{ github.ref }}" - run: | - echo $GITHUB_REF - if [ "$GITHUB_REF" == "refs/heads/main" ]; then - echo "HEROKU_APP=" >> $GITHUB_ENV - echo "HEROKU_BRANCH=main" >> $GITHUB_ENV - fi - echo "HEROKU_BRANCH=main" >> $GITHUB_ENV - - name: Install Heroku CLI - run: | - curl https://cli-assets.heroku.com/install.sh | sh - - name: "Deploy ${{ github.ref }} to Heroku" - uses: akhileshns/heroku-deploy@v3.13.15 - with: - heroku_api_key: ${{ secrets.HEROKU_API_KEY }} - heroku_app_name: "dsomm" - heroku_email: timo.pagel@owasp.org - branch: ${{ env.HEROKU_BRANCH }} - usedocker: true - docker_build_args: | - COMMIT_HASH - COMMIT_DATE - GIT_BRANCH - env: - COMMIT_HASH: ${{ github.sha }} - COMMIT_DATE: ${{ github.event.head_commit.timestamp }} - GIT_BRANCH: ${{ github.ref_name }} diff --git a/.releaserc.json b/.releaserc.json index 5a5728224..335a0e256 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -6,12 +6,13 @@ { "preset": "angular", "releaseRules": [ - {"breaking": true, "release": "minor"}, - {"tag": "Breaking", "release": "minor"} + {"breaking": true, "release": "major"}, + {"tag": "Breaking", "release": "major"} ] } ], "@semantic-release/release-notes-generator", + "@semantic-release/changelog", "@semantic-release/github" ] } diff --git a/Dockerfile b/Dockerfile index 7415a2d16..4fadbabe9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN mkdir -p /usr/src/app/dist/dsomm/assets && \ echo "branch: \"${GIT_BRANCH:-unknown}\"" >> /usr/src/app/dist/dsomm/assets/build-info.yaml -FROM wurstbrot/dsomm-yaml-generation:1.24.0 AS yaml +FROM wurstbrot/dsomm-yaml-generation:4.0.0 AS yaml FROM caddy:2.10.2 ENV PORT=8080 diff --git a/package.json b/package.json index 8a34fc8a1..990bccdb5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dsomm", - "version": "0.0.0", + "version": "4.0.0", "scripts": { "ng": "ng", "start": "ng serve", diff --git a/src/app/component/logo/logo.component.css b/src/app/component/logo/logo.component.css index 017a4c7a2..6f94d5c16 100644 --- a/src/app/component/logo/logo.component.css +++ b/src/app/component/logo/logo.component.css @@ -1,7 +1,13 @@ -.logo { - width: 200px; - height: auto; - text-align: center; - padding: 5px; +.logo { + width: 200px; + height: auto; + text-align: center; + padding: 5px; /*border: 3px solid blue; */ - } \ No newline at end of file +} + +/* When dark theme is active, swap the image source */ +:host-context(.dark-theme) .logo { + content: url("../../../assets/images/Dark-mode-logo.png"); + filter: none; +} \ No newline at end of file diff --git a/src/assets/images/Dark-mode-logo.png b/src/assets/images/Dark-mode-logo.png new file mode 100644 index 000000000..c39b0eced Binary files /dev/null and b/src/assets/images/Dark-mode-logo.png differ