From 4f7e04036f3ee8c7fb50cbd54adbd96cd3e99060 Mon Sep 17 00:00:00 2001 From: Vivek Vishal Date: Wed, 18 Sep 2024 13:51:53 +0000 Subject: [PATCH 1/2] chore: copy updated catalog dir to meshery/meshery docs Signed-off-by: GitHub --- .github/workflows/add-catalog.yml | 54 ++++++++++++++++++++++++++----- 1 file changed, 46 insertions(+), 8 deletions(-) diff --git a/.github/workflows/add-catalog.yml b/.github/workflows/add-catalog.yml index 5fddc3a534..d0e17831c2 100644 --- a/.github/workflows/add-catalog.yml +++ b/.github/workflows/add-catalog.yml @@ -11,33 +11,48 @@ jobs: outputs: contentID: ${{ steps.update_catalog_patterns.outputs.contentID }} steps: - - name: Checkout Code + - name: Checkout meshery.io repo uses: actions/checkout@v4 with: + path: meshery.io token: ${{ secrets.GH_ACCESS_TOKEN }} + + - name: Checkout meshery/meshery repo + uses: actions/checkout@v4 + with: + repository: meshery/meshery + path: meshery + token: ${{ secrets.GH_ACCESS_TOKEN }} + - name: Set up Go uses: actions/setup-go@v5 with: go-version: '1.21' + - name: Set env run: | echo "MESHERY_CLOUD_BASE_URL=https://meshery.layer5.io" >> $GITHUB_ENV echo "MESHERY_CATALOG_FILES_DIR=catalog" >> $GITHUB_ENV + - name: Cleanup + working-directory: ./meshery.io run: | find $MESHERY_CATALOG_FILES_DIR ! -name 'index.html' ! -name 'artifacthub-repo.yml' -maxdepth 1 -type f -delete cd ./collections/_catalog for dir in */; do find $dir -maxdepth 1 -type f -delete; done cd ../../ + - id: update_catalog_patterns name: Update Catalog Patterns in Go + working-directory: ./meshery.io/assets/artifact-hub-pkg run: | - cd assets/artifact-hub-pkg go run package.go env: GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} + - name: Update Catalog Filters if: ${{ success() }} + working-directory: ./meshery.io run: | catalogFilters=$(curl -sS "$MESHERY_CLOUD_BASE_URL/api/catalog/content/filter" 2>./err.txt) if [[ "$( + commit_options: "--signoff" + commit_message: "[Docs] Update _catalog directory" + branch: master + + - name: Pull latest changes from meshery.io + run: | + cd meshery.io + git pull origin master + + - name: Commit changes to meshery.io repo + uses: stefanzweifel/git-auto-commit-action@v5 + with: + repository: ./meshery.io commit_user_name: l5io commit_user_email: ci@layer5.io commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> commit_options: '--signoff' commit_message: '[Catalog] Update Catalog items' + branch: master + - name: Send Email on Workflow Failure if: ${{ failure() }} uses: dawidd6/action-send-mail@v3.7.1 From 502589b30d177ffc4bf97a9617bc23aac8e28032 Mon Sep 17 00:00:00 2001 From: Vivek Vishal Date: Wed, 18 Sep 2024 23:08:04 +0530 Subject: [PATCH 2/2] Apply suggestions from code review Signed-off-by: Vivek Vishal --- .github/workflows/add-catalog.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/add-catalog.yml b/.github/workflows/add-catalog.yml index d0e17831c2..d87d095493 100644 --- a/.github/workflows/add-catalog.yml +++ b/.github/workflows/add-catalog.yml @@ -139,7 +139,7 @@ jobs: done rm temp.json - - name: Copy catalog directory + - name: copy catalog directory to docs run: | mkdir -p meshery/docs/_catalog cp -R meshery.io/collections/_catalog/* meshery/docs/_catalog/ @@ -157,7 +157,7 @@ jobs: commit_user_email: ci@layer5.io commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> commit_options: "--signoff" - commit_message: "[Docs] Update _catalog directory" + commit_message: "[Docs] Update _catalog collection" branch: master - name: Pull latest changes from meshery.io