Skip to content

Commit

Permalink
Add demo (#45)
Browse files Browse the repository at this point in the history
* Add demo website

* Copy demo website

* Use add and remove

* Rename to add and remove
  • Loading branch information
wipfli authored Apr 8, 2022
1 parent d6e155d commit 0e50d2d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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: |
Expand All @@ -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 <https://github.com/wipfli/maplibre-gl-js/tree/gh-pages/pulls/${{ github.event.number }}> and <https://maplibre.org/maplibre-gl-js/pulls/${{ github.event.number }}>.
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 }}).
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 <https://github.com/wipfli/maplibre-gl-js/tree/gh-pages/pulls/>.
Removed build output and live demo.
26 changes: 26 additions & 0 deletions test/integration/pr-demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Display a map</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<script src="maplibre-gl.js"></script>
<link href="maplibre-gl.css" rel="stylesheet" />
<style>
body { margin: 0; padding: 0; }
#map { position: absolute; top: 0; bottom: 0; width: 100%; }
</style>
</head>
<body>
<div id="map"></div>
<script>
new maplibregl.Map({
container: 'map',
style: 'https://demotiles.maplibre.org/style.json',
center: [0, 0],
zoom: 1
});
</script>

</body>
</html>

0 comments on commit 0e50d2d

Please sign in to comment.