From 1265cdee3551b5d0d87ed19161ad2cf029b777ad Mon Sep 17 00:00:00 2001 From: Yurii Shynbuiev Date: Tue, 18 Feb 2025 23:57:36 +0700 Subject: [PATCH] =?UTF-8?q?build:=20fix=20a=20couple=20of=20links=20and=20?= =?UTF-8?q?add=20linkator=20to=20check=20all=20broken=20links=20of=20?= =?UTF-8?q?=E2=80=A6=20(#211)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: a couple of links and add linkator to check all broken links of the live site Signed-off-by: Yurii Shynbuiev * build: cleanup old workflows Signed-off-by: Yurii Shynbuiev * docs: add instruction to run linkinator locally Signed-off-by: Yurii Shynbuiev --------- Signed-off-by: Yurii Shynbuiev --- .github/workflows/build-docs.yml | 54 -------------------- .github/workflows/delete_old_packages.yml | 26 ---------- .github/workflows/deployment.yml | 54 -------------------- .github/workflows/link-check.yml | 41 ++++++++++++++++ .github/workflows/release-gh-pages.yml | 3 +- .github/workflows/release.yml | 60 ----------------------- .linkinatorrc.json | 17 +++++++ README.md | 15 ++++-- documentation/home/identus/overview.md | 2 +- 9 files changed, 71 insertions(+), 201 deletions(-) delete mode 100644 .github/workflows/build-docs.yml delete mode 100644 .github/workflows/delete_old_packages.yml delete mode 100644 .github/workflows/deployment.yml create mode 100644 .github/workflows/link-check.yml delete mode 100644 .github/workflows/release.yml create mode 100644 .linkinatorrc.json diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml deleted file mode 100644 index 6bdeb1796..000000000 --- a/.github/workflows/build-docs.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Documentation build - -on: - push: - branches: - - main - pull_request: - workflow_dispatch: - inputs: - branch: - description: "Branch to build the does from" - required: false - default: "main" - -defaults: - run: - shell: bash - -env: - REGISTRY: ghcr.io - IMAGE_NAME: identus-documentation-portal - -jobs: - build: - runs-on: ubuntu-latest - if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - fetch-depth: 0 - - - name: Update submodules - run: | - git submodule update --remote --recursive - - uses: actions/setup-node@v4 - with: - node-version: "lts/*" - - name: Install dependencies - run: yarn install - - name: Build website - run: | - yarn build --out-dir infra/website - release: - if: github.event_name == 'push' && !contains(github.event.head_commit.message, 'chore(release)') - uses: ./.github/workflows/release.yml - secrets: inherit - deploy: - if: startsWith(github.ref, 'refs/tags') && contains(github.event.head_commit.message, 'chore(release)') - uses: ./.github/workflows/deployment.yml - with: - version: "${{ github.ref_name }}" - env: "staging" - secrets: inherit diff --git a/.github/workflows/delete_old_packages.yml b/.github/workflows/delete_old_packages.yml deleted file mode 100644 index 84806c1b7..000000000 --- a/.github/workflows/delete_old_packages.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Cleanup Package Versions - -# This workflow is executed every Monday at 3:00 AM and deletes outdated versions of packages for the current repository. -# GitHub Action actions/delete-package-versions@v4 is used. -# Current retention policy: -# - Keep 10 last packages - -on: - workflow_dispatch: - schedule: - - cron: "0 3 * * 1" - -permissions: - packages: write - -jobs: - cleanup: - runs-on: ubuntu-latest - steps: - - uses: actions/delete-package-versions@v4 - with: - owner: ${{ github.repository_owner }} - package-name: identus-documentation-portal - package-type: container - min-versions-to-keep: 10 - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml deleted file mode 100644 index 1492ca4b1..000000000 --- a/.github/workflows/deployment.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Deployment - -# Trigger deployment when a new tag is pushed -# to a service component -on: - workflow_call: - inputs: - version: - required: true - type: string - env: - required: false - type: string - default: "staging" - workflow_dispatch: - inputs: - version: - description: "Document tag to deploy, e.g v1.76.1" - required: true - env: - description: "Target environment: staging or production" - required: false - default: "staging" - push: - tags: - - "v*" - -permissions: - contents: write - -jobs: - trigger-deployment: - runs-on: ubuntu-latest - steps: - - name: Parse input parameters - id: parse-params - run: | - if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then - echo "VERSION=${{ github.event.inputs.version }}" >> "${GITHUB_OUTPUT}" - echo "ENV=${{ github.event.inputs.env }}" >> "${GITHUB_OUTPUT}" - elif [[ "${{ github.event_name }}" == "workflow_call" ]]; then - echo "VERSION=${{ inputs.version }}" >> "${GITHUB_OUTPUT}" - echo "ENV=${{ inputs.env }}" >> "${GITHUB_OUTPUT}" - else - echo "VERSION=${GITHUB_REF#refs/tags/}" >> "${GITHUB_OUTPUT}" - echo "ENV=staging" >> "${GITHUB_OUTPUT}" - fi - - name: Trigger deployment - uses: peter-evans/repository-dispatch@v3 - with: - token: ${{ secrets.ATALA_GITHUB_TOKEN }} # Personal access token that triggers the deployment (Hyperledger => IOG) - repository: input-output-hk/atala-prism-non-prod-argocd-state - event-type: trigger-prism-documentation-deployment - client-payload: '{"version": "${{ steps.parse-params.outputs.VERSION }}", "env": "${{ steps.parse-params.outputs.ENV }}"}' diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml new file mode 100644 index 000000000..fd17ea0d6 --- /dev/null +++ b/.github/workflows/link-check.yml @@ -0,0 +1,41 @@ +name: Check Broken Links + +on: + workflow_dispatch: + push: + branches: [ main ] # Runs on push to main branch + schedule: + - cron: "0 12 * * 1" # Runs every Monday at 12:00 UTC + +jobs: + check-links: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + sparse-checkout: .linkinatorrc.json + sparse-checkout-cone-mode: false + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "18" + + - name: Wait for GitHub Pages deployment + run: sleep 60s # Delay to allow deployment to complete + + - name: Get short SHA + run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + + - name: Check links on the live site + run: | + echo "Commit SHA: $SHORT_SHA" + npx linkinator https://hyperledger-identus.github.io/docs/ --config .linkinatorrc.json --format text + npx linkinator https://hyperledger-identus.github.io/docs/ --config .linkinatorrc.json > link-check-results.json + + - name: Upload Linkinator output + uses: actions/upload-artifact@v4 + with: + name: linkinator-results-${{ env.SHORT_SHA }} + path: link-check-results.txt \ No newline at end of file diff --git a/.github/workflows/release-gh-pages.yml b/.github/workflows/release-gh-pages.yml index 540e313d9..b97390b83 100644 --- a/.github/workflows/release-gh-pages.yml +++ b/.github/workflows/release-gh-pages.yml @@ -14,7 +14,6 @@ on: - "gh-pages" push: branches: [main] - tags: ["v*"] jobs: ghpages: @@ -37,7 +36,7 @@ jobs: yarn build - name: Deploy - if: (inputs.force_deploy_ghpages == true) || (github.ref == 'refs/heads/main') || startsWith(github.ref, 'refs/tags/v') + if: (inputs.force_deploy_ghpages == true) || (github.ref == 'refs/heads/main') # https://github.com/marketplace/actions/github-pages-action uses: peaceiris/actions-gh-pages@v3 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 3ec53bee7..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Release docs image - -on: - workflow_call: - workflow_dispatch: - inputs: - release-branch: - description: "Branch to release from" - required: false - default: "main" - -jobs: - release: - env: - GITHUB_ACTOR: "hyperledger-bot" - GITHUB_ACTOR_EMAIL: "hyperledger-bot@hyperledger.org" - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - token: ${{ secrets.IDENTUS_CI }} - ref: ${{ github.event.inputs.release-branch }} - fetch-depth: 0 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: "lts/*" - - - uses: crazy-max/ghaction-import-gpg@v6 - id: import_gpg - with: - gpg_private_key: ${{ secrets.HYP_BOT_GPG_PRIVATE }} - passphrase: ${{ secrets.HYP_BOT_GPG_PASSWORD }} - git_user_signingkey: true - git_commit_gpgsign: true - git_config_global: true - git_tag_gpgsign: false - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ env.GITHUB_ACTOR }} - password: ${{ env.GITHUB_TOKEN }} - - - name: Release - env: - GIT_AUTHOR_EMAIL: ${{ steps.import_gpg.outputs.email }} - GIT_COMMITTER_EMAIL: ${{ steps.import_gpg.outputs.email }} - GIT_AUTHOR_NAME: ${{ steps.import_gpg.outputs.name }} - GIT_COMMITTER_NAME: ${{ steps.import_gpg.outputs.name }} - GITHUB_TOKEN: ${{ secrets.IDENTUS_CI }} - run: | - npm install - npx semantic-release diff --git a/.linkinatorrc.json b/.linkinatorrc.json new file mode 100644 index 000000000..672255b61 --- /dev/null +++ b/.linkinatorrc.json @@ -0,0 +1,17 @@ +{ + "recurse": true, + "concurrency": 10, + "format": "JSON", + "verbosity": "info", + "timeout": 30000, + "skip": [ + "https://example.org/*", + "https://example.com/*", + "https://example-verifier.com/*", + "https://my.domain.com/*", + "http://issuer-agent.com/*", + "https://didcomm.org/*", + "http://localhost*", + "https://host.docker.internal*" + ] +} diff --git a/README.md b/README.md index 7a457d954..a7d9bc385 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,9 @@ This website is built using [Docusaurus 2](https://docusaurus.io/). * etc. ## `sdk`: SDKs documentation -* enterprise-sdk -* wallet-sdk +* sdk-ts +* sdk-swift +* sdk-kmp ## `api`: autogenerated docs from OpenAPI specs `documentation/api` directory contains auto-generated documentation for RestAPI endpoints provided by Identus executables, it's auto-generated and should not be added manually. @@ -40,7 +41,7 @@ brew install yarn # Create new projects directory cd ~ && mkdir projects && cd projects -git clone https://github.com/hyperledger/identus-docs.git +git clone https://github.com/hyperledger-identus/docs.git # Initialize submodules git submodule init # Update submodules @@ -50,7 +51,7 @@ git submodule update --remote --recursive # git checkout feature-branch # Deploy local version of the website -cd identus-docs +cd docs yarn install yarn start ``` @@ -70,3 +71,9 @@ $ yarn build --out-dir infra/website ``` This command creates a set of static resources which can be hosted to serve the full site. + +## Run [linkinator](https://github.com/JustinBeckwith/linkinator) locally to check the broken links of the live website + +```shell +$ npx linkinator https://hyperledger-identus.github.io/docs/ --config .linkinatorrc.json --format text +``` diff --git a/documentation/home/identus/overview.md b/documentation/home/identus/overview.md index a6ee8d08a..70be2eb9f 100644 --- a/documentation/home/identus/overview.md +++ b/documentation/home/identus/overview.md @@ -8,4 +8,4 @@ Identus is a toolset designed for Decentralized Identity enablement. These tools * [Mediator](mediator): The Mediator acts as a bridge between the [holder's](/home/concepts/glossary#holder) device and other actors, such as [issuers](/home/concepts/glossary#issuer) and [verifiers](/home/concepts/glossary#verifier), ensuring secure and reliable communication without centralized management​​​​. -* Edge Agent SDKs: allow the development of edge agents - Decentralized Identity mobile apps and browser extensions. The SDKs are available in [Swift](https://hyperledger-identus.github.io/edge-agent-sdk-swift/documentation/edgeagentsdk/) (iOS and other Apple OS), [TS](https://hyperledger-identus.github.io/docs/sdk-ts/sdk) (Browser and Node.js), and [Kotlin Multiplatform](https://hyperledger-identus.github.io/edge-agent-sdk-kmp/) (JVM and Android) +* Edge Agent SDKs: allow the development of edge agents - Decentralized Identity mobile apps and browser extensions. The SDKs are available in [Swift](https://hyperledger-identus.github.io/sdk-swift/documentation/edgeagentsdk/) (iOS and other Apple OS), [TS](https://hyperledger-identus.github.io/docs/sdk-ts/sdk) (Browser and Node.js), and [Kotlin Multiplatform](https://hyperledger-identus.github.io/sdk-kmp/) (JVM and Android)