Skip to content

Site

Site #152

Workflow file for this run

name: Site
on:
schedule:
- cron: "0 0 * * 0"
push:
branches: [main]
paths:
- "site/**"
- "extensions/**"
jobs:
site:
name: Build & Deploy Website
runs-on: ubuntu-latest
if: ${{ github.repository == 'substrait-io/substrait' }}
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Upgrade pip
run: |
# install pip=>20.1 to use "pip cache dir"
python3 -m pip install --upgrade pip
- name: Get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('site/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: python3 -m pip install -r ./site/requirements.txt
- name: Get collaborators
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api graphql -f query='{
repository(owner: "substrait-io", name: "substrait") {
collaborators {
edges {
permission
}
nodes {
name
company
}
}
}
}' | jq '[
[
[.data.repository.collaborators.edges[] | .permission],
[.data.repository.collaborators.nodes[] | .name],
[.data.repository.collaborators.nodes[] | .company]
]
| transpose[]
| {
permission: .[0],
name: .[1],
company: .[2]
}
]' > collaborators.json
- name: smc.yaml
run: |
jq 'map(select(.permission == "ADMIN"))
| map({
"Name":.name,
"Company":.company
})' collaborators.json | yq -P > site/data/smc.yaml
- name: committers.yaml
run: |
jq 'map(select(.permission == "WRITE"))
| map({
"Name":.name,
"Company":.company
})' collaborators.json | yq -P > site/data/committers.yaml
- name: Generate Static Site
run: mkdocs build
working-directory: ./site
- name: Deploy Static Site to GitHub
uses: peaceiris/actions-gh-pages@v3
with:
external_repository: substrait-io/substrait.io
publish_branch: main
deploy_key: ${{ secrets.SUBSTRAIT_SITE_DEPLOY_KEY }}
publish_dir: ./site/site
cname: substrait.io