Skip to content

Commit 0c72404

Browse files
authored
ci: fix version_docs workflow for pnpm workspace setup (#1124)
- Use pnpm --filter ./website exec instead of cd website && pnpm exec - Disable prettify step — it references docs/guides/*.md which doesn't exist (never did in this repo) - Remove [skip ci] from commit message so the docs workflow deploys the new version
1 parent 7a3ffa7 commit 0c72404

4 files changed

Lines changed: 18 additions & 31 deletions

File tree

.github/workflows/check.yaml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ concurrency:
1818

1919
jobs:
2020
build:
21-
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
21+
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[docs build]') }}
2222

2323
name: Build
2424

@@ -42,7 +42,7 @@ jobs:
4242
run: pnpm run update-docs
4343

4444
lint:
45-
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
45+
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[docs build]') }}
4646

4747
name: Lint & Format
4848

@@ -66,7 +66,7 @@ jobs:
6666
run: pnpm run format
6767

6868
test_local:
69-
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
69+
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[docs build]') }}
7070

7171
name: Local Tests
7272

@@ -105,7 +105,7 @@ jobs:
105105
run: pnpm run test:local
106106

107107
test_api:
108-
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
108+
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[docs build]') }}
109109

110110
name: API Tests
111111

@@ -134,7 +134,7 @@ jobs:
134134
run: pnpm run test:api
135135

136136
test_python_support:
137-
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
137+
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[docs build]') }}
138138

139139
name: Python Support
140140

@@ -174,7 +174,7 @@ jobs:
174174
run: pnpm run test:python
175175

176176
docs:
177-
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
177+
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[docs build]') }}
178178

179179
name: Docs build
180180

@@ -192,13 +192,10 @@ jobs:
192192
uses: apify/workflows/pnpm-install@main
193193

194194
- name: Build & deploy docs
195-
run: |
196-
cd website
197-
pnpm install
198-
pnpm run build
195+
run: pnpm --filter apify-cli-website run build
199196

200197
build_bundles:
201-
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
198+
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[docs build]') }}
202199

203200
name: Bundles (${{ matrix.label }})
204201

.github/workflows/docs.yaml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,9 @@ jobs:
3535

3636
- name: Build docs
3737
run: |
38-
# update next docs reference
3938
pnpm run update-docs
40-
# go to website dir
41-
cd website
42-
# install website deps
43-
pnpm install
44-
# install the latest theme version
45-
pnpm add @apify/docs-theme@latest
46-
# build the docs
47-
pnpm run build
39+
pnpm --filter apify-cli-website add @apify/docs-theme@latest
40+
pnpm --filter apify-cli-website run build
4841
env:
4942
SMARTLOOK_PROJECT_KEY: ${{ secrets.SMARTLOOK_DOCS_PROJECT_KEY }}
5043
GIT_USER: "apify-service-account:${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}"
@@ -56,7 +49,7 @@ jobs:
5649
uses: stefanzweifel/git-auto-commit-action@v7
5750
with:
5851
commit_message: "chore: Automatic theme updating workflow [skip ci]"
59-
file_pattern: "website/package*.json website/pnpm-lock.yaml"
52+
file_pattern: "website/package*.json pnpm-lock.yaml"
6053
commit_user_name: Apify Bot
6154
commit_user_email: my-github-actions-bot@example.org
6255
commit_author: Apify Bot <apify@apify.com>

.github/workflows/version_docs.yaml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,15 @@ jobs:
3030
VERSION=$(jq -r '.version' package.json)
3131
MAJOR_MINOR=$(echo "$VERSION" | cut -d. -f1,2)
3232
echo "version=$VERSION" >> $GITHUB_OUTPUT
33-
cd website
34-
rm -rf versioned_docs/version-$MAJOR_MINOR
35-
rm -rf versioned_sidebars/version-$MAJOR_MINOR-sidebars.json
36-
jq --arg v "$MAJOR_MINOR" 'map(select(. != $v))' versions.json > tmp.json && mv tmp.json versions.json
37-
pnpm exec docusaurus docs:version $MAJOR_MINOR
38-
39-
- name: Format
40-
working-directory: website
41-
run: pnpm run prettify
33+
rm -rf website/versioned_docs/version-$MAJOR_MINOR
34+
rm -rf website/versioned_sidebars/version-$MAJOR_MINOR-sidebars.json
35+
jq --arg v "$MAJOR_MINOR" 'map(select(. != $v))' website/versions.json > website/tmp.json && mv website/tmp.json website/versions.json
36+
pnpm --filter apify-cli-website exec -- docusaurus docs:version $MAJOR_MINOR
4237
4338
- name: Commit and push the version snapshot
4439
uses: EndBug/add-and-commit@v10
4540
with:
4641
author_name: Apify Release Bot
4742
author_email: noreply@apify.com
48-
message: "docs: version docs for ${{ steps.version.outputs.version }} [skip ci]"
43+
message: "docs: version docs for ${{ steps.version.outputs.version }} [docs build]"
4944
pull: "--rebase --autostash"

website/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
2+
"name": "apify-cli-website",
3+
"private": true,
24
"scripts": {
35
"examples": "docusaurus-examples",
46
"start": "rimraf .docusaurus && docusaurus start",

0 commit comments

Comments
 (0)