Skip to content

Build Site

Build Site #1047

Workflow file for this run

# 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