2024-01-21 03:38:40 +00:00
|
|
|
name: Deploy to neocities
|
|
|
|
|
|
|
|
# only run on changes to main
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
|
|
|
concurrency: # prevent concurrent deploys doing strange things
|
|
|
|
group: deploy-to-neocities
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
# Default to bash
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy:
|
2024-01-21 05:15:10 +00:00
|
|
|
runs-on: ubuntu-latest
|
2024-01-21 03:38:40 +00:00
|
|
|
env:
|
|
|
|
HUGO_VERSION: "0.121.1"
|
|
|
|
steps:
|
|
|
|
- name: Install Hugo CLI
|
|
|
|
run: |
|
|
|
|
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
|
|
|
|
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
|
|
|
|
- name: Install Dart Sass
|
|
|
|
run: sudo snap install dart-sass
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
- name: Install Node.js dependencies
|
|
|
|
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
|
|
|
|
- name: Build with Hugo
|
|
|
|
env:
|
|
|
|
# For maximum backward compatibility with Hugo modules
|
|
|
|
HUGO_ENVIRONMENT: production
|
|
|
|
HUGO_ENV: production
|
|
|
|
run: |
|
|
|
|
hugo \
|
2024-01-21 18:52:45 +00:00
|
|
|
--minify
|
2024-01-21 03:38:40 +00:00
|
|
|
- name: Highlight with Torchlight
|
2024-01-21 13:59:53 +00:00
|
|
|
run: |
|
|
|
|
npm i @torchlight-api/torchlight-cli
|
|
|
|
npx torchlight
|
2024-01-21 03:38:40 +00:00
|
|
|
- name: Deploy to neocities
|
|
|
|
uses: bcomnes/deploy-to-neocities@v1
|
|
|
|
with:
|
|
|
|
api_token: ${{ secrets.NEOCITIES_API_TOKEN }}
|
2024-01-21 04:01:44 +00:00
|
|
|
cleanup: false
|
2024-01-21 03:38:40 +00:00
|
|
|
dist_dir: public
|