Merge pull request #1531 from medizininformatik-initiative/renovate/s… #4583
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: Pages | |
| on: | |
| push: | |
| tags: [ "v*.*.*" ] | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "**" ] | |
| merge_group: | |
| workflow_dispatch: | |
| # Declare default permissions as read only. | |
| permissions: read-all | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| env: | |
| MAVEN_ARGS: -B -U -T1C -Dfts.retryTimeout=false | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Used in `settings.xml` generated by actions/setup-java | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: 21 | |
| cache: 'maven' | |
| - name: Build Images | |
| run: make all | |
| - name: Get Latest Release Tag using GitHub Script | |
| id: gh_latest_tag | |
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 | |
| with: | |
| script: | | |
| const latestRelease = await github.rest.repos.getLatestRelease({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| }); | |
| const latestTag = latestRelease.data.tag_name || "v0.0.0"; // Default if no release | |
| console.log(`Latest tag: ${latestTag}`); | |
| core.setOutput("latest_tag", latestTag); | |
| - name: Clear Application Yamls | |
| working-directory: .github/test | |
| run: | | |
| echo "" | tee cd-agent/application.yaml rd-agent/application.yaml tc-agent/application.yaml | |
| sed -i 's#https://localhost#http://localhost#g' tc-agent/compose.yaml | |
| - name: Build OpenAPI Specs | |
| working-directory: docs | |
| run: make generate-openapi | |
| - name: Setup Node | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | |
| with: | |
| node-version: 21 | |
| cache: npm | |
| cache-dependency-path: 'docs/package-lock.json' | |
| - name: Build Documentation | |
| working-directory: docs | |
| env: | |
| DOCS_BASE: "/${{ github.event.repository.name }}/" | |
| VITE_LATEST_RELEASE: ${{ steps.gh_latest_tag.outputs.latest_tag }} | |
| run: make build | |
| - name: Setup Pages | |
| uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0 | |
| with: | |
| path: docs/.vitepress/dist | |
| deploy: | |
| if: github.ref_name == github.event.repository.default_branch | |
| runs-on: ubuntu-24.04 | |
| needs: [ build ] | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0 | |
| with: | |
| egress-policy: audit | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 |