From 0e50d2de00910401d39b68f5ff493b2becb20f43 Mon Sep 17 00:00:00 2001 From: Oliver Wipfli Date: Fri, 8 Apr 2022 09:26:13 +0200 Subject: [PATCH] Add demo (#45) * Add demo website * Copy demo website * Use add and remove * Rename to add and remove --- ...deploy-build-on-pr.yml => add-pr-demo.yml} | 9 ++++--- ...ove-build-on-pr.yml => remove-pr-demo.yml} | 8 +++--- test/integration/pr-demo/index.html | 26 +++++++++++++++++++ 3 files changed, 35 insertions(+), 8 deletions(-) rename .github/workflows/{deploy-build-on-pr.yml => add-pr-demo.yml} (74%) rename .github/workflows/{remove-build-on-pr.yml => remove-pr-demo.yml} (74%) create mode 100644 test/integration/pr-demo/index.html diff --git a/.github/workflows/deploy-build-on-pr.yml b/.github/workflows/add-pr-demo.yml similarity index 74% rename from .github/workflows/deploy-build-on-pr.yml rename to .github/workflows/add-pr-demo.yml index 738eeee380..470474d788 100644 --- a/.github/workflows/deploy-build-on-pr.yml +++ b/.github/workflows/add-pr-demo.yml @@ -1,11 +1,11 @@ -name: Deploy build on pull request +name: Add PR Demo on: pull_request: types: [opened, synchronize] jobs: - deploy-build-on-pr: + add-pr-demo: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -24,6 +24,7 @@ jobs: npm run build-css npm run build-benchmarks npm run generate-typings + cp test/integration/pr-demo/index.html dist/index.html - name: Empty postinstall.js run: | @@ -43,6 +44,6 @@ jobs: - name: Add comment uses: marocchino/sticky-pull-request-comment@v2 with: - header: build + header: pr-demo message: | - Build output available at and . + Uploaded [build output](https://github.com/wipfli/maplibre-gl-js/tree/gh-pages/pulls/${{ github.event.number }}) and created a [live demo](https://maplibre.org/maplibre-gl-js/pulls/${{ github.event.number }}). diff --git a/.github/workflows/remove-build-on-pr.yml b/.github/workflows/remove-pr-demo.yml similarity index 74% rename from .github/workflows/remove-build-on-pr.yml rename to .github/workflows/remove-pr-demo.yml index 1a071eaeed..f83e1ccecb 100644 --- a/.github/workflows/remove-build-on-pr.yml +++ b/.github/workflows/remove-pr-demo.yml @@ -1,11 +1,11 @@ -name: Remove Build on Pull Request +name: Remove PR Demo on: pull_request: types: [closed] jobs: - remove-build-on-pull-request: + remove-pr-demo: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -24,6 +24,6 @@ jobs: - name: Add comment uses: marocchino/sticky-pull-request-comment@v2 with: - header: build + header: pr-demo message: | - Build output was removed from . + Removed build output and live demo. diff --git a/test/integration/pr-demo/index.html b/test/integration/pr-demo/index.html new file mode 100644 index 0000000000..bb53185e1f --- /dev/null +++ b/test/integration/pr-demo/index.html @@ -0,0 +1,26 @@ + + + + +Display a map + + + + + + +
+ + + +