Skip to content

Build and Deploy Gist Blog #1775

Build and Deploy Gist Blog

Build and Deploy Gist Blog #1775

Workflow file for this run

name: Build and Deploy Gist Blog
on:
push:
branches: [master]
paths:
- 'src/**'
- '.github/workflows/**'
workflow_dispatch:
schedule:
- cron: '05 * * * *' # at :05 every hour
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
env:
GIST_USERNAME: ${{ github.repository_owner }}
SITE_URL: https://rbstp.dev
environment: github-pages
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Test
run: npm test
- name: Build site
env:
GIST_CACHE: true
GITHUB_TOKEN: ${{ secrets.GIST_BLOG_TOKEN }}
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './dist'
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4