docs(gh-pages): migrate site to jekyll format (#3517)
67
.github/workflows/update-pages.yml
vendored
@ -3,10 +3,15 @@ name: Build GH-Pages
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [master]
|
||||
types: [opened, synchronize, reopened]
|
||||
branches:
|
||||
- master
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- reopened
|
||||
push:
|
||||
branches: [master]
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
@ -14,49 +19,29 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
update_pages:
|
||||
prep:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Checkout gh-pages
|
||||
uses: actions/checkout@v4
|
||||
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: Prepare gh-pages
|
||||
run: |
|
||||
# empty contents
|
||||
rm -f -r ./gh-pages/*
|
||||
|
||||
# copy template back to pages
|
||||
cp -f -r ./gh-pages-template/. ./gh-pages/
|
||||
|
||||
- name: Upload Artifacts
|
||||
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: gh-pages
|
||||
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
|
||||
path: |
|
||||
${{ github.workspace }}/gh-pages
|
||||
!**/*.git
|
||||
name: prep
|
||||
path: gh-pages-template/
|
||||
if-no-files-found: error
|
||||
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 == 'workflow_dispatch')
|
||||
uses: actions-js/push@v1.5
|
||||
with:
|
||||
github_token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
author_email: ${{ secrets.GH_BOT_EMAIL }}
|
||||
author_name: ${{ secrets.GH_BOT_NAME }}
|
||||
directory: gh-pages
|
||||
branch: gh-pages
|
||||
force: false
|
||||
message: sync gh-pages to ${{ github.sha }}
|
||||
call-jekyll-build:
|
||||
needs: prep
|
||||
uses: LizardByte/LizardByte.github.io/.github/workflows/jekyll-build.yml@master
|
||||
with:
|
||||
site_artifact: 'prep'
|
||||
target_branch: 'gh-pages'
|
||||
clean_gh_pages: true
|
||||
secrets:
|
||||
GH_BOT_EMAIL: ${{ secrets.GH_BOT_EMAIL }}
|
||||
GH_BOT_NAME: ${{ secrets.GH_BOT_NAME }}
|
||||
GH_BOT_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
|
||||
|
||||
4
gh-pages-template/_config.yml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
# See https://github.com/daattali/beautiful-jekyll/blob/master/_config.yml for documented options
|
||||
|
||||
avatar: "/Sunshine/assets/img/navbar-avatar.png"
|
||||
|
Before Width: | Height: | Size: 6.2 MiB After Width: | Height: | Size: 6.2 MiB |
|
Before Width: | Height: | Size: 1.8 MiB After Width: | Height: | Size: 1.8 MiB |
|
Before Width: | Height: | Size: 5.9 MiB After Width: | Height: | Size: 5.9 MiB |
|
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 5.0 MiB After Width: | Height: | Size: 5.0 MiB |
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.4 MiB |
BIN
gh-pages-template/assets/img/navbar-avatar.png
Normal file
|
After Width: | Height: | Size: 20 KiB |