24
24
docs-only : ${{ steps.filter.outputs.docs_count == steps.filter.outputs.all_count }}
25
25
docs : ${{ steps.filter.outputs.docs }}
26
26
go : ${{ steps.filter.outputs.go }}
27
- ts : ${{ steps.filter.outputs.ts }}
27
+ site : ${{ steps.filter.outputs.site }}
28
28
k8s : ${{ steps.filter.outputs.k8s }}
29
29
ci : ${{ steps.filter.outputs.ci }}
30
30
db : ${{ steps.filter.outputs.db }}
92
92
gomod:
93
93
- "go.mod"
94
94
- "go.sum"
95
- ts :
95
+ site :
96
96
- "site/**"
97
- - "Makefile"
98
97
k8s:
99
98
- "helm/**"
100
99
- "scripts/Dockerfile"
@@ -774,7 +773,7 @@ jobs:
774
773
test-js :
775
774
runs-on : ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
776
775
needs : changes
777
- if : needs.changes.outputs.ts == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
776
+ if : needs.changes.outputs.site == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
778
777
timeout-minutes : 20
779
778
steps :
780
779
- name : Harden Runner
@@ -805,7 +804,7 @@ jobs:
805
804
# - premium: true
806
805
# name: test-e2e-premium
807
806
# Skip test-e2e on forks as they don't have access to CI secrets
808
- if : (needs.changes.outputs.go == 'true' || needs.changes.outputs.ts == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main') && !(github.event.pull_request.head.repo.fork)
807
+ if : (needs.changes.outputs.go == 'true' || needs.changes.outputs.site == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main') && !(github.event.pull_request.head.repo.fork)
809
808
timeout-minutes : 20
810
809
name : ${{ matrix.variant.name }}
811
810
steps :
@@ -874,11 +873,13 @@ jobs:
874
873
path : ./site/test-results/**/debug-pprof-*.txt
875
874
retention-days : 7
876
875
876
+ # Reference guide:
877
+ # https://www.chromatic.com/docs/turbosnap-best-practices/#run-with-caution-when-using-the-pull_request-event
877
878
chromatic :
878
879
# REMARK: this is only used to build storybook and deploy it to Chromatic.
879
880
runs-on : ubuntu-latest
880
881
needs : changes
881
- if : needs.changes.outputs.ts == 'true' || needs.changes.outputs.ci == 'true'
882
+ if : needs.changes.outputs.site == 'true' || needs.changes.outputs.ci == 'true'
882
883
steps :
883
884
- name : Harden Runner
884
885
uses : step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
@@ -888,9 +889,10 @@ jobs:
888
889
- name : Checkout
889
890
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
890
891
with :
891
- # Required by Chromatic for build-over-build history, otherwise we
892
- # only get 1 commit on shallow checkout.
892
+ # 👇 Ensures Chromatic can read your full git history
893
893
fetch-depth : 0
894
+ # 👇 Tells the checkout which commit hash to reference
895
+ ref : ${{ github.event.pull_request.head.ref }}
894
896
895
897
- name : Setup Node
896
898
uses : ./.github/actions/setup-node
@@ -900,7 +902,7 @@ jobs:
900
902
# the check to pass. This is desired in PRs, but not in mainline.
901
903
- name : Publish to Chromatic (non-mainline)
902
904
if : github.ref != 'refs/heads/main' && github.repository_owner == 'coder'
903
- uses : chromaui/action@30b6228aa809059d46219e0f556752e8672a7e26 # v11.11 .0
905
+ uses : chromaui/action@1cfa065cbdab28f6ca3afaeb3d761383076a35aa # v11.29 .0
904
906
env :
905
907
NODE_OPTIONS : " --max_old_space_size=4096"
906
908
STORYBOOK : true
@@ -915,6 +917,7 @@ jobs:
915
917
projectToken : 695c25b6cb65
916
918
workingDir : " ./site"
917
919
storybookBaseDir : " ./site"
920
+ storybookConfigDir : " ./site/.storybook"
918
921
# Prevent excessive build runs on minor version changes
919
922
skip : " @(renovate/**|dependabot/**)"
920
923
# Run TurboSnap to trace file dependencies to related stories
@@ -931,7 +934,7 @@ jobs:
931
934
# infinitely "in progress" in mainline unless we re-review each build.
932
935
- name : Publish to Chromatic (mainline)
933
936
if : github.ref == 'refs/heads/main' && github.repository_owner == 'coder'
934
- uses : chromaui/action@30b6228aa809059d46219e0f556752e8672a7e26 # v11.11 .0
937
+ uses : chromaui/action@1cfa065cbdab28f6ca3afaeb3d761383076a35aa # v11.29 .0
935
938
env :
936
939
NODE_OPTIONS : " --max_old_space_size=4096"
937
940
STORYBOOK : true
@@ -944,6 +947,7 @@ jobs:
944
947
projectToken : 695c25b6cb65
945
948
workingDir : " ./site"
946
949
storybookBaseDir : " ./site"
950
+ storybookConfigDir : " ./site/.storybook"
947
951
# Run TurboSnap to trace file dependencies to related stories
948
952
# and tell chromatic to only take snapshots of relevant stories
949
953
onlyChanged : true
0 commit comments