Skip to content

Commit 666581f

Browse files
committed
polish workflows
1 parent bf985de commit 666581f

File tree

5 files changed

+75
-90
lines changed

5 files changed

+75
-90
lines changed

.github/workflows/apiary.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/docs.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ jobs:
2828
registry-url: 'https://npm.pkg.github.com/'
2929
scope: '@apify-packages'
3030

31-
- name: Enable corepack
32-
run: |
33-
corepack enable
31+
- name: Enable corepack
32+
run: |
33+
corepack enable
3434
3535
- name: Build docs
3636
run: |

.github/workflows/lychee.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ jobs:
2121
registry-url: 'https://npm.pkg.github.com/'
2222
scope: '@apify-packages'
2323

24+
- name: Enable corepack
25+
run: |
26+
corepack enable
27+
2428
- name: Build docs
2529
run: |
2630
npm ci --force

.github/workflows/publish-theme.yaml

Lines changed: 66 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,33 @@ on:
88

99
jobs:
1010
look_for_change:
11-
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
12-
runs-on: ubuntu-latest
13-
outputs:
14-
theme_changed: ${{ steps.changed-theme-files.outputs.any_changed }}
15-
steps:
16-
- uses: actions/checkout@v4
17-
with:
18-
fetch-depth: 0
19-
20-
- name: Use Node.js 22
21-
uses: actions/setup-node@v4
22-
with:
23-
node-version: 22
24-
25-
- name: Check changes in theme
26-
id: changed-theme-files
27-
uses: tj-actions/changed-files@v45
28-
with:
29-
since_last_remote_commit: "true"
30-
files: |
31-
apify-docs-theme/**
11+
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
12+
runs-on: ubuntu-latest
13+
outputs:
14+
theme_changed: ${{ steps.changed-theme-files.outputs.any_changed }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Use Node.js 22
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 22
24+
cache: 'npm'
25+
cache-dependency-path: 'package-lock.json'
26+
27+
- name: Enable corepack
28+
run: |
29+
corepack enable
30+
31+
- name: Check changes in theme
32+
id: changed-theme-files
33+
uses: tj-actions/changed-files@v45
34+
with:
35+
since_last_remote_commit: "true"
36+
files: |
37+
apify-docs-theme/**
3238
3339
publish:
3440
needs: look_for_change
@@ -47,6 +53,10 @@ jobs:
4753
cache-dependency-path: 'package-lock.json'
4854
always-auth: 'true'
4955

56+
- name: Enable corepack
57+
run: |
58+
corepack enable
59+
5060
- name: Setup git user and npm
5161
run: |
5262
git config --global user.name "Apify Release Bot"
@@ -70,33 +80,33 @@ jobs:
7080
GIT_USER: "barjin:${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}"
7181
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
7282

73-
- name: Wait until the new theme version is available on npm
74-
run: |
75-
cd $GITHUB_WORKSPACE/apify-docs-theme
76-
PACKAGE_JSON=$(cat package.json);
77-
PACKAGE_NAME=$(jq -r .name <(echo $PACKAGE_JSON));
78-
PACKAGE_VER=$(jq -r .version <(echo $PACKAGE_JSON));
79-
for i in $(seq 1 10); do
80-
EXIT_CODE=0;
81-
npm show $PACKAGE_NAME@$PACKAGE_VER || EXIT_CODE=1;
82-
if [[ $EXIT_CODE -eq 1 ]]; then
83-
echo "The new package version ($PACKAGE_VER) is not yet available, waiting 30 seconds...";
84-
sleep 30;
85-
continue;
86-
fi;
87-
echo "The new package version ($PACKAGE_VER) is live, proceeding!";
88-
break;
89-
done;
90-
npm show $PACKAGE_NAME@$PACKAGE_VER # fails if the package is not available, succeeds if it is
91-
92-
- name: Commit the new theme version
93-
uses: stefanzweifel/git-auto-commit-action@v5
94-
with:
95-
commit_message: 'chore: publish new version of @apify/docs-theme [skip ci]'
96-
file_pattern: 'apify-docs-theme/package*.json'
97-
commit_user_name: Apify Bot
98-
commit_user_email: [email protected]
99-
commit_author: Apify Bot <[email protected]>
83+
- name: Wait until the new theme version is available on npm
84+
run: |
85+
cd $GITHUB_WORKSPACE/apify-docs-theme
86+
PACKAGE_JSON=$(cat package.json);
87+
PACKAGE_NAME=$(jq -r .name <(echo $PACKAGE_JSON));
88+
PACKAGE_VER=$(jq -r .version <(echo $PACKAGE_JSON));
89+
for i in $(seq 1 10); do
90+
EXIT_CODE=0;
91+
npm show $PACKAGE_NAME@$PACKAGE_VER || EXIT_CODE=1;
92+
if [[ $EXIT_CODE -eq 1 ]]; then
93+
echo "The new package version ($PACKAGE_VER) is not yet available, waiting 30 seconds...";
94+
sleep 30;
95+
continue;
96+
fi;
97+
echo "The new package version ($PACKAGE_VER) is live, proceeding!";
98+
break;
99+
done;
100+
npm show $PACKAGE_NAME@$PACKAGE_VER # fails if the package is not available, succeeds if it is
101+
102+
- name: Commit the new theme version
103+
uses: stefanzweifel/git-auto-commit-action@v5
104+
with:
105+
commit_message: 'chore: publish new version of @apify/docs-theme [skip ci]'
106+
file_pattern: 'apify-docs-theme/package*.json'
107+
commit_user_name: Apify Bot
108+
commit_user_email: [email protected]
109+
commit_author: Apify Bot <[email protected]>
100110

101111
rebuild-docs:
102112
needs: publish
@@ -109,10 +119,10 @@ jobs:
109119

110120
runs-on: ubuntu-latest
111121
steps:
112-
- env:
113-
GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
114-
run: |
115-
gh workflow run docs.yaml --repo ${{ matrix.repo }}
122+
- env:
123+
GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
124+
run: |
125+
gh workflow run docs.yaml --repo ${{ matrix.repo }}
116126
117127
rebuild-python-docs:
118128
needs: publish
@@ -124,7 +134,7 @@ jobs:
124134

125135
runs-on: ubuntu-latest
126136
steps:
127-
- env:
128-
GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
129-
run: |
130-
gh workflow run build_and_deploy_docs.yaml --repo ${{ matrix.repo }}
137+
- env:
138+
GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
139+
run: |
140+
gh workflow run build_and_deploy_docs.yaml --repo ${{ matrix.repo }}

docusaurus.config.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,9 @@ module.exports = {
220220
// '@docusaurus/plugin-client-redirects',
221221
// {
222222
// createRedirects(existingPath) {
223-
// // TODO change to `api/v2` once we are ready
224-
// if (existingPath.endsWith('api/v2-new')) {
225-
// return `${existingPath}/api/v2-new/apify-api`;
223+
// if (!existingPath.endsWith('/')) {
224+
// return `${existingPath}/`;
226225
// }
227-
// // if (!existingPath.endsWith('/')) {
228-
// // return `${existingPath}/`;
229-
// // }
230226
//
231227
// return undefined; // Return a falsy value: no redirect created
232228
// },

0 commit comments

Comments
 (0)