Skip to content

Build and deploy GH Pages #867

Build and deploy GH Pages

Build and deploy GH Pages #867

Workflow file for this run

on:
push:
branches:
- main
schedule:
# run every day at 1 AM
- cron: '0 1 * * *'
workflow_dispatch:
# Stops the running workflow of previous pushes
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
name: Build and deploy GH Pages
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 18
# needs the package-lock.json file
# cache: 'npm'
- name: Install npm dependencies
run: npm install
- name: Build npm
env:
NODE_ENV: production
run: npm run build
- name: Download crates.io db dump
id: download-crates-io-dump
uses: carlosperate/download-file-action@v2
with:
file-url: 'https://static.crates.io/db-dump.tar.gz'
location: './.tmp'
- uses: dtolnay/rust-toolchain@stable
- name: Run crates.io DB dump scraper
run: cargo run
- name: Build Zola and deploy
uses: shalzz/[email protected]
env:
# Target branch
PAGES_BRANCH: gh-pages
# Provide personal access token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}