Skip to content

Commit b6f73ad

Browse files
authored
chore(docs-theme): enable OIDC-based publishing to npm (#2085)
Closes #2083
1 parent fe8313f commit b6f73ad

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

.github/workflows/publish-theme.yaml renamed to .github/workflows/publish-to-npm.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
- master
77
workflow_dispatch:
88

9+
permissions:
10+
id-token: write
11+
contents: write
12+
913
jobs:
1014
look_for_change:
1115
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
@@ -17,7 +21,7 @@ jobs:
1721
with:
1822
fetch-depth: 0
1923

20-
- name: Use Node.js 22
24+
- name: Use Node.js
2125
uses: actions/setup-node@v6
2226
with:
2327
node-version: 24
@@ -45,11 +49,12 @@ jobs:
4549
with:
4650
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
4751

48-
- name: Use Node.js 22
52+
- name: Use Node.js
4953
uses: actions/setup-node@v6
5054
with:
5155
node-version: 24
5256
cache: 'npm'
57+
registry-url: 'https://registry.npmjs.org'
5358
cache-dependency-path: 'package-lock.json'
5459
always-auth: 'true'
5560

@@ -62,9 +67,6 @@ jobs:
6267
git config --global user.name "Apify Release Bot"
6368
git config --global user.email "[email protected]"
6469
65-
echo "access=public" > ~/.npmrc
66-
echo "//registry.npmjs.org/:_authToken=${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}" >> ~/.npmrc
67-
6870
- name: Bump the theme version
6971
run: |
7072
cd $GITHUB_WORKSPACE/apify-docs-theme
@@ -73,10 +75,7 @@ jobs:
7375
- name: Deploy theme to npm
7476
run: |
7577
cd $GITHUB_WORKSPACE/apify-docs-theme
76-
npx -y publish-if-not-exists
77-
env:
78-
GIT_USER: "barjin:${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}"
79-
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
78+
npm publish
8079
8180
- name: Wait until the new theme version is available on npm
8281
run: |

0 commit comments

Comments
 (0)