GitHub Pages #1183
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: GitHub Pages | |
on: | |
schedule: | |
- cron: '0 0 * * *' # rebuilds at Midnight everyday | |
push: | |
branches: | |
- main # Set a branch to deploy | |
pull_request: | |
env: | |
HUGO_ENVIRONMENT: production | |
HUGO_ENV: production | |
NODE_ENV: production | |
BABEL_ENV: production | |
HUGO_GA_ID: G-KQGSFFY1XV | |
jobs: | |
deploy: | |
runs-on: ubuntu-20.04 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true # Fetch Hugo themes (true OR recursive) | |
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: '0.117.0' | |
extended: true | |
- name: Setup Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- run: | | |
python -m pip install arxiv requests unidecode ujson | |
python scripts/cobiss_parser.py | |
- run: npm ci | |
- run: hugo --gc --minify --environment production --baseURL=https://sensorlab.github.io/ | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
if: ${{ github.ref == 'refs/heads/main' }} | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public |