Skip to content

Commit 4be1664

Browse files
authored
Add GitHub Deployments for website and storybook environments (#15)
* Add GitHub Deployments for website, use named environments for storybook * Remove dependency on 'test' job for website-preview in GitHub Actions workflow * Merge deployment comments into one shared sticky comment
1 parent b10de2c commit 4be1664

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,14 @@ jobs:
2323

2424
website:
2525
uses: ./.github/workflows/website.yml
26+
with:
27+
environment: production
2628
secrets: inherit
2729

2830
storybook:
2931
uses: ./.github/workflows/storybook.yml
32+
with:
33+
environment: storybook
3034
secrets: inherit
3135

3236
# release:

.github/workflows/pr.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,15 @@ jobs:
2323

2424
website-preview:
2525
uses: ./.github/workflows/website.yml
26+
with:
27+
environment: preview
2628
if: ${{ !github.event.pull_request.head.repo.fork }}
2729
secrets: inherit
2830

2931
storybook-preview:
3032
uses: ./.github/workflows/storybook.yml
33+
with:
34+
environment: storybook-preview
3135
if: ${{ !github.event.pull_request.head.repo.fork }}
3236
secrets: inherit
3337

.github/workflows/storybook.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@ name: Storybook
22

33
on:
44
workflow_call:
5+
inputs:
6+
environment:
7+
type: string
8+
required: true
59

610
jobs:
711
deployment:
812
runs-on: ubuntu-24.04
13+
environment:
14+
name: ${{ inputs.environment }}
15+
url: ${{ steps.deploy.outputs.pages-deployment-alias-url }}
916
steps:
1017
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
1118
with:
@@ -29,7 +36,6 @@ jobs:
2936
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
3037
command: |
3138
pages deploy packages/design-system/storybook-static --project-name=the-guild-docs-storybook --branch=${{ github.event.pull_request.number != '' && format('pr-{0}', github.event.pull_request.number) || 'main' }}
32-
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
3339
3440
- name: find deployment comment
3541
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.1.0

.github/workflows/website.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
on:
22
workflow_call:
3+
inputs:
4+
environment:
5+
type: string
6+
required: true
37

48
jobs:
59
deployment:
610
runs-on: ubuntu-24.04
11+
environment:
12+
name: ${{ inputs.environment }}
13+
url: ${{ steps.deploy.outputs.deployment-url }}
714
steps:
815
- name: checkout
916
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

0 commit comments

Comments
 (0)