-
Notifications
You must be signed in to change notification settings - Fork 47
44 lines (37 loc) · 1.65 KB
/
version_docs.yaml
File metadata and controls
44 lines (37 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Version docs
on:
workflow_dispatch:
workflow_call:
jobs:
version_docs:
name: Version docs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
ref: ${{ github.event.repository.default_branch }}
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: 24
- name: Install pnpm and dependencies
uses: apify/workflows/pnpm-install@main
- name: Snapshot the current version
id: version
run: |
VERSION=$(jq -r '.version' package.json)
MAJOR_MINOR=$(echo "$VERSION" | cut -d. -f1,2)
echo "version=$VERSION" >> $GITHUB_OUTPUT
rm -rf website/versioned_docs/version-$MAJOR_MINOR
rm -rf website/versioned_sidebars/version-$MAJOR_MINOR-sidebars.json
jq --arg v "$MAJOR_MINOR" 'map(select(. != $v))' website/versions.json > website/tmp.json && mv website/tmp.json website/versions.json
pnpm --filter apify-cli-website exec -- docusaurus docs:version $MAJOR_MINOR
- name: Commit and push the version snapshot
uses: EndBug/add-and-commit@v10
with:
author_name: Apify Release Bot
author_email: noreply@apify.com
message: "docs: version docs for ${{ steps.version.outputs.version }}"
pull: "--rebase --autostash"