From d40f4b6c3ba27a8a1e9786ec3df3eb1202b8f100 Mon Sep 17 00:00:00 2001 From: mahula Date: Sun, 26 Nov 2023 19:09:35 +0100 Subject: [PATCH 01/11] adapt file filter to documentation automation requirements --- .github/file-filters.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/file-filters.yml b/.github/file-filters.yml index 7dd58c68f..9573ae288 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -12,5 +12,15 @@ webapp: &webapp - 'webapp/**/*' - 'package.json' -markdown-files: &markdown-files +markdown: &markdown - '**/*.md' + '.github/workflows/mlc_config.json' + +vuepress: &vuepress + - '.github/workflows/deploy-documentation.yml' + - '.vuepress/**/*' + - 'package.json' + +documentation: &documentation + - vuepress + - markdown From ca03692e0af730fcb30770dc3c21fadbe4156579 Mon Sep 17 00:00:00 2001 From: mahula Date: Sun, 26 Nov 2023 19:14:05 +0100 Subject: [PATCH 02/11] adapt check dokumentation workflow to documentation automation requirements --- .github/workflows/check-documentation.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-documentation.yml b/.github/workflows/check-documentation.yml index d374f41e8..d38cfad3a 100644 --- a/.github/workflows/check-documentation.yml +++ b/.github/workflows/check-documentation.yml @@ -7,7 +7,8 @@ jobs: name: Detect File Changes - Markdown files runs-on: ubuntu-latest outputs: - markdown-files: ${{ steps.changes.outputs.markdown-files }} + markdown: ${{ steps.changes.outputs.markdown }} + vuepress: ${{ steps.changes.outputs.vuepress }} steps: - name: Checkout code uses: actions/checkout@master @@ -22,9 +23,9 @@ jobs: check-markdown-links: name: Check Markdown links - if: needs.files-changed.outputs.markdown-files == 'true' needs: files-changed runs-on: ubuntu-latest + if: needs.files-changed.outputs.markdown == 'true' steps: - name: Checkout code uses: actions/checkout@master From d0eedae61d0ccd4f42107d920d037430baa76a2f Mon Sep 17 00:00:00 2001 From: mahula Date: Mon, 27 Nov 2023 09:46:59 +0100 Subject: [PATCH 03/11] update workflow file filter --- .github/file-filters.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/file-filters.yml b/.github/file-filters.yml index 9573ae288..186941d27 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -14,13 +14,15 @@ webapp: &webapp markdown: &markdown - '**/*.md' - '.github/workflows/mlc_config.json' + - '.github/workflows/check-documentation.yml' + - '.github/workflows/mlc_config.json' vuepress: &vuepress + - '.github/workflows/check-documentation.yml' - '.github/workflows/deploy-documentation.yml' - '.vuepress/**/*' - 'package.json' documentation: &documentation - - vuepress - - markdown + - *vuepress + - *markdown From 68c812840593f7800a0c54fc0ff9fb84149a4713 Mon Sep 17 00:00:00 2001 From: mahula Date: Mon, 27 Nov 2023 10:09:43 +0100 Subject: [PATCH 04/11] refactor documentation check workflow --- .github/workflows/check-documentation.yml | 23 ++++++++++++++++++++++- package.json | 1 + 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-documentation.yml b/.github/workflows/check-documentation.yml index d38cfad3a..51a96adae 100644 --- a/.github/workflows/check-documentation.yml +++ b/.github/workflows/check-documentation.yml @@ -29,7 +29,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@master - - name: Check Markdown Links + + - name: Check Markdown Links uses: gaurav-nelson/github-action-markdown-link-check@master with: use-quiet-mode: 'yes' @@ -39,3 +40,23 @@ jobs: config-file: '.github/workflows/mlc_config.json' base-branch: 'master' folder-path: '.' + + test-vuepress-build: + name: Test Vuepress build + needs: files-changed + runs-on: ubuntu-latest + if: needs.files-changed.outputs.vuepress == 'true' + steps: + - name: Checkout code + uses: actions/checkout@master + + - name: Setup Node 20 + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: yarn-install + run: yarn install + + - name: yarn-docs:build + run: yarn run docs:build diff --git a/package.json b/package.json index 1cbccdb6d..8f222d653 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "scripts": { "db:seed": "cd backend && yarn run db:seed", "db:reset": "cd backend && yarn run db:reset", + "docs:build": "NODE_OPTIONS=--openssl-legacy-provider vuepress build docs", "cypress:run": "cypress run --e2e --browser electron --config-file ./cypress/cypress.config.js", "cypress:open": "cypress open --e2e --browser electron --config-file ./cypress/cypress.config.js", "cucumber:setup": "cd backend && yarn run dev", From ba97d0e4de693f05fd9d1d853b0d65e6e925de30 Mon Sep 17 00:00:00 2001 From: mahula Date: Mon, 27 Nov 2023 10:27:34 +0100 Subject: [PATCH 05/11] fix typo --- .github/workflows/check-documentation.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-documentation.yml b/.github/workflows/check-documentation.yml index 51a96adae..0bfd9e279 100644 --- a/.github/workflows/check-documentation.yml +++ b/.github/workflows/check-documentation.yml @@ -55,8 +55,8 @@ jobs: with: node-version: '20' - - name: yarn-install - run: yarn install + - name: npm-install + run: npm install - - name: yarn-docs:build - run: yarn run docs:build + - name: npm-docs:build + run: npm run docs:build From eb25f5f8b7a018de2df51211d9a177fefb545d80 Mon Sep 17 00:00:00 2001 From: mahula Date: Mon, 27 Nov 2023 10:28:23 +0100 Subject: [PATCH 06/11] add documentation deployment woekflow --- .github/workflows/deploy-documentation.yml | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/deploy-documentation.yml diff --git a/.github/workflows/deploy-documentation.yml b/.github/workflows/deploy-documentation.yml new file mode 100644 index 000000000..9a22f51f1 --- /dev/null +++ b/.github/workflows/deploy-documentation.yml @@ -0,0 +1,42 @@ +name: ocelot.social deploy documentation + +on: + push: + branches: + - master + +jobs: + files-changed: + name: Detect File Changes - Markdown and Vuepress files + runs-on: ubuntu-latest + outputs: + documentation: ${{ steps.changes.outputs.documentation }} + steps: + - name: Checkout code + uses: actions/checkout@master + + - name: Check for file changes + uses: dorny/paths-filter@v2.11.1 + id: changes + with: + token: ${{ github.token }} + filters: .github/file-filters.yml + list-files: shell + + build-and-deploy-documentation: + name: Build and deploy documentation + runs-on: ubuntu-latest + needs: files-changed + if: needs.files-changed.outputs.documentation == 'true' + steps: + - name: Checkout code + uses: actions/checkout@master + + - name: Vuepress Build and Deploy + uses: jenkey2011/vuepress-deploy@master + env: + ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + TARGET_REPO: Ocelot-Social-Community/Ocelot-Social + TARGET_BRANCH: gh-pages + BUILD_SCRIPT: npm install && npm run docs:build -- --config docs/.vuepress/config github.js + BUILD_DIR: .vuepress/dist From 030da181a29884dee8fe9625813f48e64466506e Mon Sep 17 00:00:00 2001 From: mahula Date: Mon, 27 Nov 2023 10:56:04 +0100 Subject: [PATCH 07/11] cleanup workflow files --- .github/workflows/check-documentation.yml | 42 +++++++++++----------- .github/workflows/deploy-documentation.yml | 20 +++++------ 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/.github/workflows/check-documentation.yml b/.github/workflows/check-documentation.yml index 0bfd9e279..80462fe8d 100644 --- a/.github/workflows/check-documentation.yml +++ b/.github/workflows/check-documentation.yml @@ -27,19 +27,19 @@ jobs: runs-on: ubuntu-latest if: needs.files-changed.outputs.markdown == 'true' steps: - - name: Checkout code - uses: actions/checkout@master + - name: Checkout code + uses: actions/checkout@master - name: Check Markdown Links - uses: gaurav-nelson/github-action-markdown-link-check@master - with: - use-quiet-mode: 'yes' - use-verbose-mode: 'no' - # at any .md file change take the chance to check the links in all .md files - check-modified-files-only: 'no' - config-file: '.github/workflows/mlc_config.json' - base-branch: 'master' - folder-path: '.' + uses: gaurav-nelson/github-action-markdown-link-check@master + with: + use-quiet-mode: 'yes' + use-verbose-mode: 'no' + # at any .md file change take the chance to check the links in all .md files + check-modified-files-only: 'no' + config-file: '.github/workflows/mlc_config.json' + base-branch: 'master' + folder-path: '.' test-vuepress-build: name: Test Vuepress build @@ -47,16 +47,16 @@ jobs: runs-on: ubuntu-latest if: needs.files-changed.outputs.vuepress == 'true' steps: - - name: Checkout code - uses: actions/checkout@master + - name: Checkout code + uses: actions/checkout@master - - name: Setup Node 20 - uses: actions/setup-node@v4 - with: - node-version: '20' + - name: Setup Node 20 + uses: actions/setup-node@v4 + with: + node-version: '20' - - name: npm-install - run: npm install + - name: npm-install + run: npm install - - name: npm-docs:build - run: npm run docs:build + - name: npm-docs:build + run: npm run docs:build diff --git a/.github/workflows/deploy-documentation.yml b/.github/workflows/deploy-documentation.yml index 9a22f51f1..3f9f090be 100644 --- a/.github/workflows/deploy-documentation.yml +++ b/.github/workflows/deploy-documentation.yml @@ -29,14 +29,14 @@ jobs: needs: files-changed if: needs.files-changed.outputs.documentation == 'true' steps: - - name: Checkout code - uses: actions/checkout@master + - name: Checkout code + uses: actions/checkout@master - - name: Vuepress Build and Deploy - uses: jenkey2011/vuepress-deploy@master - env: - ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} - TARGET_REPO: Ocelot-Social-Community/Ocelot-Social - TARGET_BRANCH: gh-pages - BUILD_SCRIPT: npm install && npm run docs:build -- --config docs/.vuepress/config github.js - BUILD_DIR: .vuepress/dist + - name: Vuepress Build and Deploy + uses: jenkey2011/vuepress-deploy@master + env: + ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + TARGET_REPO: Ocelot-Social-Community/Ocelot-Social + TARGET_BRANCH: gh-pages + BUILD_SCRIPT: npm install && npm run docs:build -- --config docs/.vuepress/config github.js + BUILD_DIR: .vuepress/dist From 8f2c6ababb9fa42b49d9ebf490594041fa32c8f6 Mon Sep 17 00:00:00 2001 From: mahula Date: Thu, 25 Jan 2024 10:38:00 +0100 Subject: [PATCH 08/11] config doc deployment in doc deployment workflow --- .github/file-filters.yml | 9 ++++-- .github/workflows/deploy-documentation.yml | 32 +++++++++++++--------- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/.github/file-filters.yml b/.github/file-filters.yml index 186941d27..1cc5438ce 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -12,13 +12,16 @@ webapp: &webapp - 'webapp/**/*' - 'package.json' -markdown: &markdown - - '**/*.md' +docs-check: &docs-check - '.github/workflows/check-documentation.yml' + +markdown: &markdown + - *docs-check + - '**/*.md' - '.github/workflows/mlc_config.json' vuepress: &vuepress - - '.github/workflows/check-documentation.yml' + - *docs-check - '.github/workflows/deploy-documentation.yml' - '.vuepress/**/*' - 'package.json' diff --git a/.github/workflows/deploy-documentation.yml b/.github/workflows/deploy-documentation.yml index 3f9f090be..9a2716a5d 100644 --- a/.github/workflows/deploy-documentation.yml +++ b/.github/workflows/deploy-documentation.yml @@ -16,27 +16,33 @@ jobs: uses: actions/checkout@master - name: Check for file changes - uses: dorny/paths-filter@v2.11.1 + uses: dorny/paths-filter@master id: changes with: token: ${{ github.token }} filters: .github/file-filters.yml list-files: shell - build-and-deploy-documentation: - name: Build and deploy documentation + build-and-deploy: runs-on: ubuntu-latest - needs: files-changed - if: needs.files-changed.outputs.documentation == 'true' steps: - - name: Checkout code + - name: Checkout uses: actions/checkout@master - - name: Vuepress Build and Deploy - uses: jenkey2011/vuepress-deploy@master + - name: Setup Node 20 + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Build Vuepress Pages + run: npm install && npm run build + + - name: Deploy Vuepress to Github Pages + uses: crazy-max/ghaction-github-pages@v4 + with: + target_branch: gh-pages + build_dir: .vuepress/dist + author: Wolfgang Huß + fqdn: docs.ocelot.social env: - ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} - TARGET_REPO: Ocelot-Social-Community/Ocelot-Social - TARGET_BRANCH: gh-pages - BUILD_SCRIPT: npm install && npm run docs:build -- --config docs/.vuepress/config github.js - BUILD_DIR: .vuepress/dist + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 7f00c08e02d0949788202a7ea57dc2ca070ce7a7 Mon Sep 17 00:00:00 2001 From: mahula Date: Thu, 25 Jan 2024 10:44:07 +0100 Subject: [PATCH 09/11] set correct file filter in docs check workflow --- .github/workflows/check-documentation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-documentation.yml b/.github/workflows/check-documentation.yml index 80462fe8d..cf5c53cce 100644 --- a/.github/workflows/check-documentation.yml +++ b/.github/workflows/check-documentation.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest outputs: markdown: ${{ steps.changes.outputs.markdown }} - vuepress: ${{ steps.changes.outputs.vuepress }} + documentation: ${{ steps.changes.outputs.documentation }} steps: - name: Checkout code uses: actions/checkout@master @@ -45,7 +45,7 @@ jobs: name: Test Vuepress build needs: files-changed runs-on: ubuntu-latest - if: needs.files-changed.outputs.vuepress == 'true' + if: needs.files-changed.outputs.documentation == 'true' steps: - name: Checkout code uses: actions/checkout@master From e6213febeb7132236f03aa1b4e42516975d8e2a6 Mon Sep 17 00:00:00 2001 From: mahula Date: Thu, 25 Jan 2024 11:27:21 +0100 Subject: [PATCH 10/11] fix doc chech workflow --- .github/workflows/check-documentation.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/check-documentation.yml b/.github/workflows/check-documentation.yml index cf5c53cce..49b3e1ac1 100644 --- a/.github/workflows/check-documentation.yml +++ b/.github/workflows/check-documentation.yml @@ -29,6 +29,9 @@ jobs: steps: - name: Checkout code uses: actions/checkout@master + + - name: Remove old documentation files + run: rm -rf ./deployment/src/old/ ./CHANGELOG.md # workaround until https://github.com/gaurav-nelson/github-action-markdown-link-check/pull/183 has been done - name: Check Markdown Links uses: gaurav-nelson/github-action-markdown-link-check@master From c2338902ebf8e4026f48b83f39ce53df22545b41 Mon Sep 17 00:00:00 2001 From: mahula Date: Thu, 25 Jan 2024 11:54:45 +0100 Subject: [PATCH 11/11] Revert "ci(other): improve structure and readability of auto-generated changelog" --- .github/workflows/publish.yml | 36 ++++------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 28d975767..17c764b38 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -260,38 +260,10 @@ jobs: version: ${{ env.BUILD_VERSION }} git_commit_sha: ${{ github.sha }} git_tag_prefix: "b" - - name: Generate changelog - id: changelog - uses: mikepenz/release-changelog-builder-action@v4 - with: - configurationJson: | - { - "pr_template": "- ##{{NUMBER}} #{{TITLE}} #{{ASSIGNEES}}", - "categories": [ - { - "title": "### 🚀 Features", - "labels": ["feat"] - }, - { - "title": "### 🐛 Fixes", - "labels": ["fix"] - }, - { - "title": "### 💬 Refactoring, Documentation & Other", - "labels": ["chore","ci","docs","refactor"] - }, - { - "title": "### 📦 Build & Dependencies", - "labels": ["build","bump"] - } - ], - "max_pull_requests": 1000, - "max_back_track_time_days": 1000 - } - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + run: | + yarn install + yarn auto-changelog --latest-version ${{ env.VERSION }} --unreleased-only - name: package-version-to-git-release continue-on-error: true # Will fail if tag exists id: create_release @@ -301,7 +273,7 @@ jobs: with: tag_name: ${{ env.VERSION }} release_name: ${{ env.VERSION }} - body: ${{steps.changelog.outputs.changelog}} + body_path: ./CHANGELOG.md draft: false prerelease: false