Skip to content

Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.

feat(ci): snapshot docs automatically on minor/major publish (#2344)

Jindřich Bär092f51e8e85d
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 4600b6407..d042f7bb5 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -169,3 +169,55 @@ jobs:
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
repository: apify/crawlee
event-type: crawlee-docker-image-bump
+
+ version-docs:
+ needs: release
+ runs-on: ubuntu-latest
+ if: (github.event.inputs.version == 'minor' || github.event.inputs.version == 'major')
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
+ fetch-depth: 0
+
+ - name: Use Node.js 20
+ uses: actions/setup-node@v4
+ with:
+ node-version: 20
+
+ - name: Install jq
+ run: sudo apt-get install jq
+
+ - name: Enable corepack
+ run: |
+ corepack enable
+ corepack prepare yarn@stable --activate
+
+ - name: Activate cache for Node.js 20
+ uses: actions/setup-node@v4
+ with:
+ cache: 'yarn'
+
+ - name: Install dependencies
+ run: |
+ # install project deps
+ yarn
+ # install website deps
+ cd website
+ yarn
+
+ - name: Snapshot the current version
+ run: |
+ cd website
+ yarn docusaurus docs:version $(jq .version ../lerna.json | sed s/\"//g | head -c 3)
+ yarn docusaurus api:version $(jq .version ../lerna.json | sed s/\"//g | head -c 3)
+
+ - name: Commit and push the version snapshot
+ run: |
+ git config --global user.name "Apify Release Bot"
+ git config --global user.email "[email protected]"
+ git add .
+ git diff-index --quiet HEAD || git commit -m 'chore(release): update docs for ${{ inputs.version }} version [skip ci]'
+ git push