-
-
Notifications
You must be signed in to change notification settings - Fork 55
43 lines (35 loc) · 1.17 KB
/
preview-label.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: CR
on:
pull_request_target:
types: [labeled, unlabeled]
jobs:
preview-pr:
if: ${{ !github.event.pull_request.draft && contains(github.event.pull_request.labels.*.name, 'preview-pr') && !contains(github.event.pull_request.labels.*.name, 'spam') && !contains(github.event.pull_request.labels.*.name, 'invalid') }}
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Set node
uses: actions/setup-node@v4
with:
node-version: lts/*
registry-url: https://registry.npmjs.org/
- uses: hunghg255/surge-preview@master
id: preview_step
with:
surge_token: ${{ secrets.SURGE_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
dist: "playground/dist"
failOnError: true
teardown: 'true'
build: |
pnpm install
pnpm run build:playground
- name: Get the preview_url
run: echo "url => ${{ steps.preview_step.outputs.preview_url }}"