-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (53 loc) · 1.66 KB
/
ci.yml
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
name: CI
# Trigger the workflow on pushes to main, pull requests or workflow dispatches
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
# Set permissions on the github.token for gh-pages use
permissions:
contents: read
pages: write
id-token: write
# Enable publication to gh pages via actions/deploy-pages@v2
concurrency:
group: "pages"
cancel-in-progress: false
# Enable use of gh
env:
GH_TOKEN: ${{ github.token }}
# 2 jobs.
# + Run the scripts to make sure they work, saving html as an artifact
# + If a deploy is needed, save the html to the gh pages branch
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- uses: actions/checkout@v3
# Build JSON
- name: Construct Json
run: python3 scripts/get_release_json.py data.json
# Build HTML
- name: Build HTML
run: mkdir -p wheelhouse && python3 scripts/build_wheelhouse.py -i data.json -o wheelhouse --baseurl https://whl.flamegpu.com/
# Save HTML for later
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./wheelhouse
# If this should deploy (push or workflow dispatch on main) to the github pages branch, do so.
# This requires "GitHub Actions" selected in github.com/org/repo/settings/pages
deploy:
if: ${{ ( github.event_name == 'workflow_dispatch' || github.event_name == 'push' ) && github.ref == 'refs/heads/main' }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2