Skip to content

Commit 5933bd8

Browse files
committed
ci: explicitly configure main branch in env variable
1 parent c7cae76 commit 5933bd8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/continuous-delivery.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88

99
env:
1010
CI: true
11+
MAIN_BRANCH: "main"
12+
MAIN_REF: "refs/heads/main"
1113

1214
jobs:
1315
install:
@@ -251,14 +253,14 @@ jobs:
251253
uses: chromaui/action@v1
252254
if: github.event.pull_request.draft == false
253255
with:
254-
autoAcceptChanges: main
256+
autoAcceptChanges: ${{ env.MAIN_BRANCH }}
255257
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
256258
storybookBuildDir: packages/storybook-css/dist/
257259

258260
publish-website:
259261
runs-on: ubuntu-latest
260262
needs: build
261-
if: github.ref == 'refs/heads/main'
263+
if: github.ref == ${{ env.MAIN_REF }}
262264

263265
steps:
264266
- name: Checkout release branch
@@ -279,15 +281,15 @@ jobs:
279281
- name: Continuous Deployment to designsystem.utrecht.nl
280282
uses: JamesIves/github-pages-deploy-action@v4.4.3
281283
with:
282-
branch: main
284+
branch: $${ env.MAIN_BRANCH }}
283285
folder: packages/design-system-website/dist/
284286
repository-name: nl-design-system/designsystem.utrecht.nl
285287
token: ${{ secrets.DOCS_GH_TOKEN }}
286288

287289
publish-npm:
288290
runs-on: ubuntu-latest
289291
needs: [lint, test]
290-
if: github.ref == 'refs/heads/main'
292+
if: github.ref == ${{ env.MAIN_REF }}
291293
env:
292294
NODE_OPTIONS: "--max-old-space-size=6114"
293295

@@ -356,7 +358,7 @@ jobs:
356358
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
357359
GIT_COMMITTER_NAME: "NL Design System"
358360
run: |
359-
git push --set-upstream origin HEAD
361+
git push --set-upstream "origin/${MAIN_BRANCH}" HEAD
360362
pnpm run release
361363
362364
- name: "Continuous Deployment: publish to npm"

0 commit comments

Comments
 (0)