Skip to content

Build and Deploy to Github Pages #130

Build and Deploy to Github Pages

Build and Deploy to Github Pages #130

name: Build and Deploy to Github Pages
on:
workflow_dispatch:
push:
branches:
- "*"
permissions:
id-token: write
contents: read
pages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup node.js
uses: actions/setup-node@v6
with:
node-version: '22.x'
- name: Install dependencies
run: npm install --omit=dev
- name: Build with webpack
run: npm run prod
- name: Setup GitHub Pages
id: pages
uses: actions/configure-pages@v5
- name: Build site with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ${{ github.ref_name == 'master' && './_site' || format('./_site/deployments/{0}', github.ref_name) }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
deploy:
environment:
name: ${{ github.ref_name == 'master' && 'github-pages' || github.ref_name }}
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