Skip to content

Commit 9a0cea5

Browse files
committed
ci: isolate surge preview token
1 parent 25018c6 commit 9a0cea5

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

.github/workflows/surge-preview.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,26 @@ jobs:
1717
preview:
1818
runs-on: ubuntu-latest
1919
env:
20-
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
2120
PREVIEW: true
2221
steps:
2322
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
2423
with:
2524
persist-credentials: false
25+
- name: Build preview
26+
if: ${{ secrets.SURGE_TOKEN != '' }}
27+
run: |
28+
npm install
29+
npm run build
2630
- uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec
27-
if: ${{ env.SURGE_TOKEN != '' }}
31+
if: ${{ secrets.SURGE_TOKEN != '' }}
32+
env:
33+
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
2834
with:
2935
surge_token: ${{ env.SURGE_TOKEN }}
3036
github_token: ${{ secrets.GITHUB_TOKEN }}
3137
dist: docs-dist
3238
failOnError: false
3339
setCommitStatus: false
34-
build: |
35-
npm install
36-
npm run build
3740
- name: Skip Surge preview
38-
if: ${{ env.SURGE_TOKEN == '' }}
41+
if: ${{ secrets.SURGE_TOKEN == '' }}
3942
run: echo "SURGE_TOKEN is not configured; skip Surge preview."

0 commit comments

Comments
 (0)