Skip to content

Fix

Fix #1980

Workflow file for this run

name: Build GitHub Pages
on:
push:
branches: main
schedule:
- cron: '0 5 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout gh-pages
uses: actions/checkout@v4
with:
path: gh_pages
ref: gh-pages
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install required Python libraries
run: pip install lxml
- name: Install Docker Compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/v2.23.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
- name: Build site
run: make prod PROD_BUILD_DIR=${GITHUB_WORKSPACE}/gh_pages
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
GOOGLE_ANALYTICS_ID: ${{ secrets.GOOGLE_ANALYTICS_ID }}
- name: Generate sitemap
run: python tools/generate_sitemap.py ${GITHUB_WORKSPACE}/gh_pages
- name: Commit filesdate +"%Y-%m-%d_%H-%M-%S"
run: |
cd ${GITHUB_WORKSPACE}/gh_pages
git config --global user.name "GitHub Action"
git config --global user.email "[email protected]"
git add .
git diff-index --quiet HEAD || git commit -m "Build $(date +"%Y-%m-%d %H:%M:%S"). ${GITHUB_SHA::8}. Event: ${GITHUB_EVENT_NAME}."
- name: Push changes
uses: ad-m/github-push-action@fe38f0a751bf9149f0270cc1fe20bf9156854365
with:
directory: ${{ github.workspace }}/gh_pages
github_token: ${{ secrets.PERSONAL_TOKEN }}
branch: gh-pages