Skip to content

Build and deploy GH Pages #350

Build and deploy GH Pages

Build and deploy GH Pages #350

Workflow file for this run

on:
push:
branches:
- main
schedule:
# run every day at 1 AM
- cron: '0 1 * * *'
# 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@v3
- uses: actions/setup-node@v3
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@v1
with:
file-url: 'https://static.crates.io/db-dump.tar.gz'
location: './.tmp'
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Run crates.io DB dump scraper
uses: actions-rs/cargo@v1
with:
command: run
# args: --release --all-features
- 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 }}