Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 28 additions & 81 deletions .github/workflows/update-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concurrency:
cancel-in-progress: true

jobs:
update_pages:
update:
permissions:
contents: read
runs-on: ubuntu-latest
Expand All @@ -25,48 +25,17 @@ jobs:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Checkout gh-pages
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: gh-pages
path: gh-pages
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of the personal token
fetch-depth: 0 # otherwise, will fail to push refs to dest repo

- name: Setup python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.14'

- name: Setup node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 'latest'

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install .

- name: Install npm dependencies
run: npm install --ignore-scripts

- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> "${GITHUB_OUTPUT}"

- name: Prepare gh-pages
run: |
# empty contents
rm -f -r ./gh-pages/*

# no jekyll
touch ./gh-pages/.nojekyll

# copy dependencies
cp -f ./node_modules/plotly.js/dist/plotly.min.js ./gh-pages/plotly.js

- name: Convert notebook
- name: Collect data
env:
DASHBOARD_AUR_REPOS: sunshine,sunshine-bin,sunshine-git
CODECOV_TOKEN: ${{ secrets.CODECOV_API_TOKEN }}
Expand All @@ -78,62 +47,40 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN || secrets.GITHUB_TOKEN }}
PATREON_CAMPAIGN_ID: 6131567
READTHEDOCS_TOKEN: ${{ secrets.READTHEDOCS_TOKEN }}
run: |
jupyter nbconvert \
--debug \
--config=./jupyter_nbconvert_config.py \
--execute \
--no-input \
--to=html \
--output-dir=./gh-pages \
--output=index \
./notebook/dashboard.ipynb
THREADING_EXCEPTION_HANDLER: "true"
run: python -u -m src.updater

- name: Cat log
if: always()
run: cat ./logs/updater.log

- name: Check notebook for tracebacks
run: |
cat ./gh-pages/index.html
echo "---"
echo "Checking for tracebacks..."
set +e
tracebacks=$(grep -i -E 'Traceback \(most recent call last\):' ./gh-pages/index.html)
set -e
if [ -n "${tracebacks}" ]; then
echo "Tracebacks found:"
echo "${tracebacks}"
exit 1
fi
- name: Build dashboard data
run: python -u -m src.builder

- name: Archive gh-pages
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
- name: Prepare Artifacts # uploading artifacts will fail if not zipped due to very large quantity of files
shell: bash
run: |
7z \
"-xr!*.git*" \
a "./gh-pages.zip" "./gh-pages"
run: 7z a build.zip ./gh-pages/* ./gh-pages-template/*

- name: Upload Artifacts
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
- name: Upload artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: gh-pages
name: update
path: ${{ github.workspace }}/build.zip
if-no-files-found: error
path: |
${{ github.workspace }}/gh-pages.zip
include-hidden-files: true
retention-days: 1

- name: Deploy to gh-pages
if: >-
(github.event_name == 'push' && github.ref == 'refs/heads/master') ||
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch'
uses: actions-js/push@5a7cbd780d82c0c937b5977586e641b2fd94acc5 # v1.5
with:
github_token: ${{ secrets.GH_BOT_TOKEN }}
author_email: ${{ secrets.GH_BOT_EMAIL }}
author_name: ${{ vars.GH_BOT_NAME }}
directory: gh-pages
branch: gh-pages
force: false
message: automatic-update-${{ steps.date.outputs.date }}
call-jekyll-build:
needs: update
permissions:
contents: read
uses: LizardByte/LizardByte.github.io/.github/workflows/jekyll-build.yml@master
secrets:
GH_BOT_EMAIL: ${{ secrets.GH_BOT_EMAIL }}
GH_BOT_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
with:
gh_bot_name: ${{ vars.GH_BOT_NAME }}
site_artifact: 'update'
extract_archive: 'build.zip'
target_branch: 'gh-pages'
clean_gh_pages: true
25 changes: 25 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2

build:
os: ubuntu-24.04
tools:
ruby: "3.3"
apt_packages:
- 7zip
- jq
jobs:
install:
- |
mkdir -p "./tmp"
branch="master"
base_url="https://raw.githubusercontent.com/LizardByte/LizardByte.github.io"
url="${base_url}/refs/heads/${branch}/scripts/readthedocs_build.sh"
curl -sSL -o "./tmp/readthedocs_build.sh" "${url}"
chmod +x "./tmp/readthedocs_build.sh"
build:
html:
- "./tmp/readthedocs_build.sh"
2 changes: 2 additions & 0 deletions gh-pages-template/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
site-js: [] # disable crowdin for this site
Loading
Loading