Skip to content

Publish Site

Publish Site #1094

Workflow file for this run

name: Publish Site
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
env:
RECOIL_LUA_LIBRARY_DIR: "rts/Lua/library"
LUA_DOC_EXTRACTOR_SOURCE_REF: "https://github.com/${{ github.repository }}/blob/${{ github.sha }}"
HUGO_VERSION: "0.147.9"
LUA_DOC_EXTRACTOR_VERSION: "3"
EMMYLUA_DOC_CLI_VERSION: "0.8.2"
JQ_VERSION: "1.8.0"
7Z_VERSION: "24.09"
RUBY_VERSION: "3.3"
MISE_ENV: "ci"
jobs:
build:
if: github.repository == 'beyond-all-reason/RecoilEngine' || github.event_name == 'workflow_dispatch'
name: Build
runs-on: ubuntu-latest
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
steps:
- name: Install Dependencies
run: |
sudo apt-get update -y
sudo apt-get install --fix-missing -y libsdl2-2.0-0 libopenal1 curl
- name: Checkout Source Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
sparse-checkout: |
doc/site
rts/Lua
rts/Rml/SolLua
- name: Cache Restore
id: cache-restore
uses: actions/cache/restore@v4
with:
path: |
${{ runner.temp }}/hugo_cache
key: hugo-${{ github.run_id }}
restore-keys:
hugo-
- name: Configure Git
run: git config core.quotepath false
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Setup Mise
uses: jdx/mise-action@v2
with:
working_directory: doc/site # [default: .] directory to run mise in
- name: Build with Hugo
env:
HUGO_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
HUGO_ENVIRONMENT: production
working-directory: ./doc/site
run: |
mise run lua_pages
mise run binary_pages
mise exec hugo -- \
hugo \
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Cache Save
id: cache-save
uses: actions/cache/save@v4
with:
path: |
${{ runner.temp }}/hugo_cache
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: doc/site/public
# Deployment job
deploy:
name: Deploy
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4