Skip to content

Commit 5d03265

Browse files
committed
add second setup-node step to change registry
1 parent 00f8c3a commit 5d03265

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

.github/workflows/publish_react_component_library.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
run: echo "GITHUB_NVMRC_VERSION=$(cat .nvmrc)" >> $GITHUB_ENV
7272
working-directory: ./packages/react-components
7373

74-
- name: Set up Node.js for GitHub Packages
74+
- name: Set up Node.js
7575
uses: actions/setup-node@v6
7676
with:
7777
node-version: ${{ env.GITHUB_NVMRC_VERSION }}
@@ -97,6 +97,14 @@ jobs:
9797
run: npm run build
9898
working-directory: ./packages/react-components
9999

100+
# After dependencies are installed and build is complete, change registry to GitHub Packages
101+
- name: Rerun Node.js setup for GitHub Packages publishing
102+
uses: actions/setup-node@v6
103+
with:
104+
node-version: ${{ env.GITHUB_NVMRC_VERSION }}
105+
registry-url: "https://npm.pkg.github.com/"
106+
scope: "@bcgov"
107+
100108
- name: Publish to GitHub Packages @next
101109
run: npm publish --tag next --registry=https://npm.pkg.github.com/
102110
working-directory: ./packages/react-components
@@ -151,7 +159,7 @@ jobs:
151159
run: echo "GITHUB_NVMRC_VERSION=$(cat .nvmrc)" >> $GITHUB_ENV
152160
working-directory: ./packages/react-components
153161

154-
- name: Set up Node.js for GitHub Packages
162+
- name: Set up Node.js
155163
uses: actions/setup-node@v6
156164
with:
157165
node-version: ${{ env.GITHUB_NVMRC_VERSION }}
@@ -164,6 +172,14 @@ jobs:
164172
run: npm run build
165173
working-directory: ./packages/react-components
166174

175+
# After dependencies are installed and build is complete, change registry to GitHub Packages
176+
- name: Rerun Node.js setup for GitHub Packages publishing
177+
uses: actions/setup-node@v6
178+
with:
179+
node-version: ${{ env.GITHUB_NVMRC_VERSION }}
180+
registry-url: "https://npm.pkg.github.com/"
181+
scope: "@bcgov"
182+
167183
- name: Publish to GitHub Packages @latest
168184
run: npm publish --tag latest --registry=https://npm.pkg.github.com/
169185
working-directory: ./packages/react-components

0 commit comments

Comments
 (0)