From 0c740538617742949db137cf523dcc7a631eb1bd Mon Sep 17 00:00:00 2001 From: Anton Bracke Date: Fri, 28 May 2021 14:50:28 +0200 Subject: [PATCH] feat: add pr preview ci --- .github/workflows/preview.yml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/preview.yml diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 0000000..4714620 --- /dev/null +++ b/.github/workflows/preview.yml @@ -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 }}" \ No newline at end of file