feat: add pr preview ci

This commit is contained in:
Anton Bracke 2021-05-28 14:50:28 +02:00
parent d1dc6eb800
commit 0c74053861

41
.github/workflows/preview.yml vendored Normal file
View File

@ -0,0 +1,41 @@
name: Preview webui
on:
pull_request_target:
paths:
- 'webui/**'
types: [opened, synchronize, reopened, closed]
jobs:
preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
run: |
cd webui/
npm install
- name: Build webui
run: |
cd webui/
npm run build
- uses: afc163/surge-preview@v1
id: preview_step
with:
surge_token: ${{ secrets.SURGE_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
teardown: 'true'
dist: webui/build
build: |
echo "dummy"
- name: Get the preview_url
run: echo "url => ${{ steps.preview_step.outputs.preview_url }}"