Skip to content

Hugo Build to GitHub Pages #6438

Hugo Build to GitHub Pages

Hugo Build to GitHub Pages #6438

Workflow file for this run

name: Hugo Build to GitHub Pages
on:
push:
branches:
- "master"
schedule:
# Every six hours update the web site
- cron: "0 */6 * * *"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "0.120.4"
extended: true
- name: Install jq
uses: r26d/jq-action@master
- name: Fetch Contributors
run: "curl https://api.github.com/repos/owncast/owncast/contributors?per_page=100 | jq 'map(.) | .[] | {login: .login, avatar_url: .avatar_url, html_url: .html_url}' | jq --slurp '.' > data/contributors-core.json"
- name: Fetch Home Page Contributors
run: "curl https://api.github.com/repos/owncast/owncast.github.io/contributors?per_page=100 | jq 'map(.) | .[] | {login: .login, avatar_url: .avatar_url, html_url: .html_url}' | jq --slurp '.' > data/contributors-homepage.json"
- name: Combine Contributors
run: "jq --argfile core data/contributors-core.json --argfile homepage data/contributors-homepage.json -n '$core + $homepage |unique_by(.login)' > data/contributors.json"
- name: Fetch donors
run: 'curl https://opencollective.com/owncast/members/all.json | jq ''map(.) | .[] | select(.role=="BACKER") | {login: .name, avatar_url: .image, html_url: .profile}'' | jq --slurp ''.'' > data/donors.json'
- name: Add current development documentation
run: mkdir -p static/api/development && curl https://raw.githubusercontent.com/owncast/owncast/master/doc/api/index.html > static/api/development/index.html
- name: Generate project roadmap
run: cd scripts && ./build-roadmap --accessToken ${{ secrets.GITHUB_TOKEN }} --milestone 26 > ../content/roadmap/index.html
- name: Commit changes
uses: EndBug/add-and-commit@v5
with:
author_name: Owncast
author_email: [email protected]
message: "Update dynamic content"
add: "static/api/development/index.html data/contributors.json content/roadmap/index.html"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: npm install && hugo --minify
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public