Skip to content

Commit 51519b8

Browse files
committed
ci: isolate surge preview token
1 parent 67028d6 commit 51519b8

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
@@ -13,23 +13,26 @@ jobs:
1313
preview:
1414
runs-on: ubuntu-latest
1515
env:
16-
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
1716
PREVIEW: true
1817
steps:
1918
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
2019
with:
2120
persist-credentials: false
21+
- name: Build preview
22+
if: ${{ secrets.SURGE_TOKEN != '' }}
23+
run: |
24+
npm install
25+
npm run build
2226
- uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec
23-
if: ${{ env.SURGE_TOKEN != '' }}
27+
if: ${{ secrets.SURGE_TOKEN != '' }}
28+
env:
29+
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
2430
with:
2531
surge_token: ${{ env.SURGE_TOKEN }}
2632
github_token: ${{ secrets.GITHUB_TOKEN }}
2733
dist: dist
2834
failOnError: false
2935
setCommitStatus: false
30-
build: |
31-
npm install
32-
npm run build
3336
- name: Skip Surge preview
34-
if: ${{ env.SURGE_TOKEN == '' }}
37+
if: ${{ secrets.SURGE_TOKEN == '' }}
3538
run: echo "SURGE_TOKEN is not configured; skip Surge preview."

0 commit comments

Comments
 (0)