88
99jobs :
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
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 }}
0 commit comments