Skip to content

Commit 1d49255

Browse files
committed
Automatically trigger workflow
1 parent 0dacc22 commit 1d49255

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

.github/workflows/deploy-preview.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: Deploy Branch Preview
22

33
on:
4+
push:
5+
branches:
6+
- preview-infra
47
workflow_dispatch:
58
inputs:
69
commit_message:

BRANCH_PREVIEW_GUIDE.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,24 +92,24 @@ Open the preview with URL parameters to specify which branches to compare:
9292

9393
### Overview
9494

95-
The deployment system uses GitHub Actions to deploy the `preview-infra` branch to `gh-pages`. The `deploy-preview.yml` workflow simply copies the already-synced branches and HTML files to GitHub Pages.
95+
The deployment system uses GitHub Actions to deploy the `preview-infra` branch to `gh-pages`. The `deploy-preview.yml` workflow is **automatically triggered** whenever you push to the `preview-infra` branch.
9696

9797
**The workflow**:
9898
1. Checks out the `preview-infra` branch
9999
2. Copies `index.html` and `viewer.html` to the deployment folder
100100
3. Copies the entire `staging/` directory (which contains all synced branches)
101101
4. Deploys everything to the `gh-pages` branch
102102

103-
**Important**: The workflow does NOT build branches. You must build and sync branches locally using `npm run preview-sync` before deploying.
103+
**Important**: The workflow does NOT build branches. You must build and sync branches locally using `npm run preview-sync` before pushing.
104104

105-
### Workflow: Build → Sync → Deploy
105+
### Workflow: Build → Sync → Push → View
106106

107107
1. **Build branches locally** (in `maplibre-gl-js`):
108108
```bash
109109
# Build main
110110
git checkout main
111111
npm run build-dev && npm run build-css
112-
112+
113113
# Build your feature
114114
git checkout my-feature
115115
npm run build-dev && npm run build-css
@@ -119,10 +119,10 @@ The deployment system uses GitHub Actions to deploy the `preview-infra` branch t
119119
```bash
120120
cd ../maplibre-preview
121121
git checkout preview-infra
122-
122+
123123
# Sync main
124124
npm run preview-sync # while main is checked out in maplibre-gl-js
125-
125+
126126
# Switch to feature branch in maplibre-gl-js, then:
127127
npm run preview-sync # syncs the feature branch
128128
```
@@ -134,12 +134,7 @@ The deployment system uses GitHub Actions to deploy the `preview-infra` branch t
134134
git push fork preview-infra
135135
```
136136

137-
4. **Deploy to GitHub Pages**:
138-
- Go to your fork on GitHub and switch to the preview-
139-
- Navigate to **Actions****Deploy Branch Preview**
140-
- Click **Run workflow**
141-
- (Optional) Add a commit message
142-
- Click **Run workflow**
137+
4. **Automatic Deployment**: GitHub Actions will detect the push to `preview-infra` and automatically deploy the updated previews to `gh-pages`. You can track progress in the **Actions** tab.
143138

144139
5. **View**: Visit `https://[your-username].github.io/maplibre-gl-js/`
145140

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<title>MapLibre Branch Previewer</title>
6+
<title>Maplibre Zoom Rounding Behavior Explorer</title>
77
<style>
88
body { margin: 0; padding: 0; font-family: sans-serif; height: 100vh; display: flex; flex-direction: column; background: #333; }
99
#header { background: #222; color: white; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; }
@@ -16,7 +16,7 @@
1616
</head>
1717
<body>
1818
<div id="header">
19-
<div><strong>MapLibre Side-by-Side Preview</strong></div>
19+
<div><strong>MapLibre Side-by-Side Comparison</strong></div>
2020
<div class="controls">
2121
<button id="align">Align</button>
2222
<label style="margin: 0 10px; font-size: 14px; cursor: pointer;">

0 commit comments

Comments
 (0)