-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (88 loc) · 2.82 KB
/
build-site.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Build Site
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 */12 * * *'
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
tags:
description: 'Manual trigger'
jobs:
detect-changes:
runs-on: ubuntu-20.04
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '3.8'
cache: 'pip'
- run: pip install requests pyyaml
- name: Update collection
run: python3 scripts/update-collection.py
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
add-paths: |
collection.yaml
commit-message: Update ShareLoc.XYZ Collection
committer: ShareLoc.XYZ <shareloc@pasteur>
author: ShareLoc.XYZ <shareloc@pasteur>
signoff: false
token: ${{ secrets.PAT }} # allow triggering CI
branch: update-collection
delete-branch: true
title: 'Update ShareLoc.XYZ Collection'
body: |
This is an automatic PR for updating the collection.
* Please check the updated items and merge this PR if they are ready.
* To block an item, you can set its `status` to `blocked`.
* You can also override the keys by adding additional keys (e.g. `tags`) into the corresponding item.
labels: |
automated pr
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '3.8'
cache: 'pip'
- run: pip install --use-pep517 -r requirements.txt
- name: Generate collection
env:
S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }}
S3_KEY: ${{ secrets.S3_KEY }}
S3_SECRET: ${{ secrets.S3_SECRET }}
run: python3 scripts/generate-collection.py --potree --csv
- name: Save build output
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v1
with:
name: built-output
path: ./dist
deploy-site:
runs-on: ubuntu-20.04
needs: build
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- name: Load saved build output
uses: actions/download-artifact@v1
with:
name: built-output
path: ./dist
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: dist