Skip to content

Update actions/cache action to v5 (#57) #232

Update actions/cache action to v5 (#57)

Update actions/cache action to v5 (#57) #232

Workflow file for this run

name: GitHub Pages CD
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
generate:
name: Generate
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Generate
run: task generate
- name: Check Diffs
run: git status | grep -q "nothing to commit, working tree clean"
build:
name: Build
runs-on: ubuntu-latest
needs:
- generate
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set Mod Cache
id: mod-cache
uses: actions/cache@v5.0.0
with:
path: ./node_modules
key: mod-${{ hashFiles('**/bun.lock') }}
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Module Download
if: steps.mod-cache.outputs.cache-hit != 'true'
run: bun install
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build
run: bun run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: .vitepress/dist
deploy:
name: Deploy
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs:
- build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
concurrency:
group: pages
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4