Skip to content

Build GitHub Pages #1509

Build GitHub Pages

Build GitHub Pages #1509

Workflow file for this run

name: Build GitHub Pages
on:
push:
branches: master
schedule:
- cron: '0 5 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Checkout gh-pages
uses: actions/checkout@v2
with:
path: gh_pages
ref: gh-pages
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Install required Python libraries
run: pip install lxml
- name: Build site
run: make prod PROD_BUILD_DIR=${GITHUB_WORKSPACE}/gh_pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOOGLE_ANALYTICS_TID: UA-158065353-1
- 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.GITHUB_TOKEN }}
branch: gh-pages