mirror of
https://github.com/lissy93/networking-toolbox.git
synced 2026-11-21 21:44:44 +03:00
74 lines
1.6 KiB
YAML
74 lines
1.6 KiB
YAML
name: 🐙 Deploy to GitHub Pages
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
base_url:
|
|
description: 'Base URL path (e.g., /networking-toolbox)'
|
|
required: false
|
|
default: '/networking-toolbox'
|
|
type: string
|
|
node_version:
|
|
description: 'Node.js version'
|
|
required: false
|
|
default: '22'
|
|
type: string
|
|
deploy_env:
|
|
description: 'Deployment environment'
|
|
required: false
|
|
default: 'static'
|
|
type: choice
|
|
options:
|
|
- static
|
|
- github-pages
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: "pages"
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Configure Pages
|
|
uses: actions/configure-pages@v5
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ inputs.node_version }}
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build static site
|
|
env:
|
|
BASE_URL: ${{ inputs.base_url }}
|
|
DEPLOY_ENV: ${{ inputs.deploy_env }}
|
|
run: npm run build:static
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: ./build
|
|
|
|
deploy:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|