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.

docs: deploy via GH actions

Martin Adámek1deb8fd2e808
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 17457ee15..000814492 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -4,66 +4,51 @@ on:
push:
branches:
- master
+ workflow_dispatch:
jobs:
build:
+ environment:
+ name: github-pages
+ permissions:
+ contents: write
+ pages: write
+ id-token: write
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
-
- - name: Use Node.js 20
- uses: actions/setup-node@v4
- with:
- node-version: 20
-
- - name: Enable corepack
- run: |
- corepack enable
- corepack prepare yarn@stable --activate
-
- - name: Set git identity
- run: |
- git config --global user.name "Martin Adámek"
- git config --global user.email "[email protected]"
-
- - name: Build & deploy docs
- run: |
- # install project deps
- yarn
- # go to website dir
- cd website
- # install website deps
- yarn
- # build and deploy the docs
- yarn deploy
- env:
- GIT_USER: 'B4nan:${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}'
- GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
- APIFY_SIGNING_TOKEN: ${{ secrets.APIFY_SIGNING_TOKEN }}
-
- squash:
- runs-on: ubuntu-latest
- needs: [build]
- steps:
- - uses: actions/checkout@v4
- with:
- ref: 'gh-pages'
- fetch-depth: 0
-
- - name: Set git identity
- run: |
- git config --global user.name "Martin Adámek"
- git config --global user.email "[email protected]"
-
- - name: Squash all commits to reduce repository size
- run: |
- TOTAL_COMMITS="$(($(git rev-list --count HEAD)-1))"
- echo "squashing $TOTAL_COMMITS commits"
- git reset HEAD~$TOTAL_COMMITS
- git add .
- git commit --amend -m 'crawlee.dev docs'
- git push --force origin gh-pages
- env:
- GIT_USER: 'B4nan:${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}'
- GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
+ - uses: actions/checkout@v4
+
+ - name: Use Node.js 20
+ uses: actions/setup-node@v4
+ with:
+ node-version: 20
+
+ - name: Enable corepack
+ run: |
+ corepack enable
+ corepack prepare yarn@stable --activate
+
+ - name: Build & deploy docs
+ run: |
+ # install project deps
+ yarn
+ # go to website dir
+ cd website
+ # install website deps
+ yarn
+ # build the docs
+ yarn build
+ env:
+ APIFY_SIGNING_TOKEN: ${{ secrets.APIFY_SIGNING_TOKEN }}
+
+ - name: Set up GitHub Pages
+ uses: actions/configure-pages@v4
+
+ - name: Upload GitHub Pages artifact
+ uses: actions/upload-pages-artifact@v2
+ with:
+ path: ./docs/build
+
+ - name: Deploy artifact to GitHub Pages
+ uses: actions/deploy-pages@v3