name: Docs # needed to securely identify the workflow on: pull_request: push: branches: [ "main" ] jobs: build-and-deploy: permissions: contents: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: lfs: true - name: Use Node.js uses: actions/setup-node@v4 with: node-version: '20.x' cache: 'yarn' - name: Install dependencies run: yarn install --immutable --immutable-cache --check-cache - name: Build run: yarn build - name: Build package docs run: yarn docs - name: Copy docs into deployment folder run: ./scripts/docs/copy_docs.sh - name: Deploy to GitHub pages if: github.ref == 'refs/heads/master' run: | git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git npx gh-pages@6 --message "Update docs [skip ci]" --dist docs_deployment -u "github-actions-bot " --nojekyll env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}