Skip to content

Commit b1ec188

Browse files
committed
ci: isolate surge preview token
1 parent e50f457 commit b1ec188

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

.github/workflows/surge-preview.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,25 @@ permissions:
1111
jobs:
1212
preview:
1313
runs-on: ubuntu-latest
14-
env:
15-
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
1614
steps:
1715
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
1816
with:
1917
persist-credentials: false
18+
- name: Build preview
19+
if: ${{ secrets.SURGE_TOKEN != '' }}
20+
run: |
21+
npm install
22+
npm run build
2023
- uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec
21-
if: ${{ env.SURGE_TOKEN != '' }}
24+
if: ${{ secrets.SURGE_TOKEN != '' }}
25+
env:
26+
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
2227
with:
2328
surge_token: ${{ env.SURGE_TOKEN }}
2429
github_token: ${{ secrets.GITHUB_TOKEN }}
2530
dist: dist
2631
failOnError: false
2732
setCommitStatus: false
28-
build: |
29-
npm install
30-
npm run build
3133
- name: Skip Surge preview
32-
if: ${{ env.SURGE_TOKEN == '' }}
34+
if: ${{ secrets.SURGE_TOKEN == '' }}
3335
run: echo "SURGE_TOKEN is not configured; skip Surge preview."

0 commit comments

Comments
 (0)