From dc9ad7939a973a09235de829492ef9a4ffd62f5e Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 4 Feb 2024 14:18:54 +0100 Subject: [PATCH] added surge preview to actions --- .github/workflows/build.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5df873e..995e53a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,7 @@ -on: [push, pull_request] +on: + pull_request: + types: [opened, synchronize, reopened, closed] + push: jobs: web: runs-on: ubuntu-latest @@ -17,6 +20,15 @@ jobs: bundler-cache: true - name: Build run: cd web && bundle exec jekyll build + + - name: Preview + if: github.event_name == 'pull_request' + uses: afc163/surge-preview@v1 + with: + surge_token: ${{ secrets.SURGE_TOKEN }} + dist: web/_site + teardown: true + build: echo # see https://github.com/afc163/surge-preview/issues/231 # this is a beautiful way to deploy a website and i will not take any criticism - name: Deploy @@ -40,6 +52,15 @@ jobs: dotnet-version: 7.0.305 - name: Build run: cd docs && dotnet tool restore && dotnet docfx + + - name: Preview + if: github.event_name == 'pull_request' + uses: afc163/surge-preview@v1 + with: + surge_token: ${{ secrets.SURGE_TOKEN }} + dist: docs/_site + teardown: true + build: echo # see https://github.com/afc163/surge-preview/issues/231 # this is a beautiful way to deploy a website and i will not take any criticism - name: Deploy