Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ jobs:
"tag": "latest"
}
version_docs:
name: Version docs
needs: [update_changelog, publish_to_npm]
uses: ./.github/workflows/version_docs.yaml
secrets: inherit

update_homebrew_formula:
name: Update Homebrew Formula
needs: [update_changelog, publish_to_npm]
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/version_docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will need to also have a run step that runs pnpm install in website (they are not workspaces but maybe they should be?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no opinion over workspace, I will create an issue and we can discuss there. Also pnpm install added.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other pnpm PRs added website to the workspace iirc, lets do it here as well. two places for inspiration are the JS client and SDK, both already migrated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok then :]


- 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
cd website
rm -rf versioned_docs/version-$MAJOR_MINOR
rm -rf versioned_sidebars/version-$MAJOR_MINOR-sidebars.json
jq --arg v "$MAJOR_MINOR" 'map(select(. != $v))' versions.json > tmp.json && mv tmp.json versions.json
pnpm exec docusaurus docs:version $MAJOR_MINOR

- name: Format
working-directory: website
run: pnpm run prettify

- 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 }} [skip ci]"
pull: "--rebase --autostash"
Loading
Loading