Build Website #2948
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Website | |
on: | |
push: | |
branches: | |
- docs | |
- blog | |
schedule: | |
- cron: "*/30 * * * *" | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }} | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
docs: | |
name: Build OpenCore HTML Docs | |
runs-on: macos-latest | |
env: | |
HOMEBREW_NO_INSTALL_CLEANUP: 1 | |
steps: | |
- name: Checkout Build Files | |
uses: actions/checkout@v4 | |
with: | |
ref: docs | |
- name: Checkout OpenCorePkg Master | |
uses: actions/checkout@v4 | |
with: | |
repository: acidanthera/OpenCorePkg | |
path: latest | |
- name: Get Latest OpenCorePkg Release | |
uses: oprypin/find-latest-tag@v1 | |
with: | |
repository: acidanthera/OpenCorePkg | |
releases-only: true | |
id: releasetag | |
- run: echo "Latest release is ${{ steps.releasetag.outputs.tag }}" | |
- name: Checkout OpenCorePkg Release | |
uses: actions/checkout@v4 | |
with: | |
repository: acidanthera/OpenCorePkg | |
path: release | |
ref: ${{ steps.releasetag.outputs.tag }} | |
- run: brew update | |
- name: Get Latest MacTeX Version | |
id: mactexversion | |
run: | | |
echo "version=$(brew info --cask basictex --json=v2 | jq -r '.casks[0].version')" >> "$GITHUB_OUTPUT" | |
- name: Set suid on gtar | |
run: sudo chown root:wheel /opt/homebrew/bin/gtar && sudo chmod u+s /opt/homebrew/bin/gtar | |
- name: Cache Brew Downloads | |
id: cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/Library/Caches/Homebrew/downloads/*tex* | |
~/Library/Caches/Homebrew/downloads/*ghostscript* | |
~/Library/Caches/Homebrew/*tex* | |
~/Library/Caches/Homebrew/*ghostscript* | |
/etc/manpaths.d/TeX | |
/etc/paths.d/TeX | |
/Library/TeX | |
/usr/local/texlive | |
key: ${{ runner.os }}-basictex-${{ steps.mactexversion.outputs.version }} | |
- name: Install Dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
brew install --cask basictex | |
- name: Refresh PATH | |
run: | | |
eval "$(/usr/libexec/path_helper)" | |
echo "$PATH" >> $GITHUB_PATH | |
- uses: shogo82148/actions-setup-perl@v1 | |
- name: Install LaTeX Dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
sudo tlmgr update --self | |
sudo tlmgr update texlive-scripts | |
sudo tlmgr install titlesec pgf datetime fmtcount zref hyperref zlmtt make4ht luaxml tex4ht context latexdiff | |
cpanm Algorithm::Diff | |
- name: Build Master Configuration | |
run: | | |
cd latest/Docs | |
sed -i '' 's/-s ONLYCHANGEDPAGE //' BuildDocs.tool | |
./BuildDocs.tool | |
make4ht Configuration.tex | |
- name: Build Master Differences | |
run: | | |
cd latest/Docs/Differences | |
make4ht Differences.tex | |
- name: Build Master Errata | |
run: | | |
cd latest/Docs/Errata | |
make4ht Errata.tex | |
- name: Build Release Configuration | |
run: | | |
cd release/Docs | |
sed -i '' 's/-s ONLYCHANGEDPAGE //' BuildDocs.tool | |
./BuildDocs.tool | |
make4ht Configuration.tex | |
- name: Build Release Differences | |
run: | | |
cd release/Docs/Differences | |
make4ht Differences.tex | |
- name: Copy Files | |
run: | | |
mkdir -p Deploy/latest Deploy/release | |
cp -R latest/Docs/*.css latest/Docs/*.html latest/Docs/*.png latest/Docs/Differences/*.css latest/Docs/Differences/*.html latest/Docs/Differences/*.png latest/Docs/Errata/*.css latest/Docs/Errata/*.html latest/Docs/Errata/*.png latest/Docs/Logos Deploy/latest/ || true | |
cp -R release/Docs/*.css release/Docs/*.html release/Docs/*.png release/Docs/Differences/*.css release/Docs/Differences/*.html release/Docs/Differences/*.png release/Docs/Errata/*.css release/Docs/Errata/*.html release/Docs/Errata/*.png release/Docs/Logos Deploy/release/ || true | |
cp Copy/Differences.css Deploy/latest/ | |
cp Copy/Differences.css Deploy/release/ | |
cp Copy/README.md Copy/main.css Deploy/ | |
echo | |
ls Deploy | |
- name: Post Build | |
run: python3 postbuild.py ${{ steps.releasetag.outputs.tag }} | |
- name: Upload Latest Docs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: latest | |
path: latest/Docs | |
- name: Upload Release Docs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: release | |
path: release/Docs | |
- name: Upload HTML Output | |
uses: actions/upload-artifact@v4 | |
with: | |
name: html | |
path: Deploy | |
website: | |
name: Build Website | |
runs-on: ubuntu-latest | |
needs: docs | |
steps: | |
- name: Checkout Build Files | |
uses: actions/checkout@v4 | |
with: | |
ref: blog | |
- name: Download Latest Docs | |
uses: actions/download-artifact@v4 | |
with: | |
name: html | |
path: docs | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Build with Jekyll | |
uses: actions/jekyll-build-pages@v1 | |
with: | |
source: ./ | |
destination: ./_site | |
- name: Upload Artifact | |
uses: actions/upload-pages-artifact@v3 | |
deploy: | |
concurrency: | |
group: "pages" | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: website | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |