forked from maplibre/maplibre-gl-js
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.66 KB
/
upload-benchmarks.yml
File metadata and controls
61 lines (52 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Upload Benchmarks
on:
push:
branches:
- main
workflow_call:
inputs:
tag:
description: 'Tagged commit to upload (e.g., v1.2.3). Leave empty for main branch.'
required: false
type: string
workflow_dispatch:
inputs:
tag:
description: 'Tagged commit to upload (e.g., v1.2.3). Leave empty for main branch.'
required: false
type: string
jobs:
upload_benchmarks:
runs-on: ubuntu-latest
steps:
- name: Determine ref
if: inputs.tag != ''
id: ref
run: |
TAG="${{ inputs.tag }}"
echo "ref=refs/tags/${TAG}" >> $GITHUB_OUTPUT
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ steps.ref.outputs.ref || 'refs/heads/main' }}
- name: Use Node.js from nvmrc
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v4
with:
node-version-file: '.nvmrc'
- name: Install
run: npm ci
- name: Build benchmarks
run: |
npm run generate-typings
npm run build-benchmarks
- name: Copy benchmarks_generated.js
run: |
mkdir tmp
cp test/bench/versions/benchmarks_generated.js tmp
cp test/bench/versions/benchmarks_generated.js.map tmp
- name: Upload to GitHub Pages
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: tmp
destination_dir: benchmarks/${{ inputs.tag || 'main' }}
commit_message: 'deploy: ${{ inputs.tag }}'