From 7436b565302db33853e28582026cd26a4d4449c9 Mon Sep 17 00:00:00 2001 From: Robson Oliveira Date: Fri, 22 Mar 2024 19:31:54 -0300 Subject: [PATCH] feat: add action to run the scraper on file changes --- .github/workflows/docsearch-scraper.yml | 45 +++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/docsearch-scraper.yml diff --git a/.github/workflows/docsearch-scraper.yml b/.github/workflows/docsearch-scraper.yml new file mode 100644 index 000000000..11d2c6ca4 --- /dev/null +++ b/.github/workflows/docsearch-scraper.yml @@ -0,0 +1,45 @@ +name: Help Center Files Scraper + +on: + pull_request: + branches: + - main + types: [closed] + +jobs: + scrape-files: + runs-on: ubuntu-latest + name: Scraper running + steps: + - uses: actions/checkout@v4 + - name: Get changed markdown files + id: changed-files + uses: tj-actions/changed-files@v43 + with: + include_all_old_new_renamed_files: "true" + files: | + **.md + **.mdx + - name: Printing + run: | + echo "All:" + echo "${{ steps.changed-files.outputs.all_changed_files }}" + echo "Added:" + echo "${{ steps.changed-files.outputs.added_files }}" + echo "Deleted:" + echo "${{ steps.changed-files.outputs.deleted_files }}" + echo "Modified:" + echo "${{ steps.changed-files.outputs.modified_files }}" + echo "Renamed:" + echo "${{ steps.changed-files.outputs.all_old_new_renamed_files }}" + - uses: actions/checkout@v2 + - name: Helpcenter Scraper + uses: vtexdocs/devportal-docsearch-action@main + with: + algolia_application_id: '${{ secrets.ALGOLIA_APP_ID }}' + algolia_api_key: ${{ secrets.ALGOLIA_WRITE_KEY }} + file: './configs/scraper_helpcenter_files.json' + added: '${{ steps.changed-files.outputs.added_files }}' + updated: '${{ steps.changed-files.outputs.modified_files }}' + removed: '${{ steps.changed-files.outputs.deleted_files }}' + renamed: '${{ steps.changed-files.outputs.all_old_new_renamed_files }}' \ No newline at end of file