Skip to content

english blog update #52

english blog update

english blog update #52

Workflow file for this run

name: Deploy GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 11.16.0
run_install: false
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Configure Pages
uses: actions/configure-pages@v5
- name: Configure the GitHub Pages path
shell: bash
run: |
owner_lower="$(printf '%s' "$GITHUB_REPOSITORY_OWNER" | tr '[:upper:]' '[:lower:]')"
repo_name="${GITHUB_REPOSITORY#*/}"
if [[ "${repo_name,,}" == "${owner_lower}.github.io" ]]; then
base_path=""
else
base_path="/${repo_name}"
fi
echo "NEXT_PUBLIC_BASE_PATH=${base_path}" >> "$GITHUB_ENV"
echo "NEXT_PUBLIC_SITE_URL=https://${owner_lower}.github.io${base_path}/" >> "$GITHUB_ENV"
- name: Check and build
env:
NEXT_PUBLIC_GISCUS_CATEGORY: ${{ vars.NEXT_PUBLIC_GISCUS_CATEGORY }}
NEXT_PUBLIC_GISCUS_CATEGORY_ID: ${{ vars.NEXT_PUBLIC_GISCUS_CATEGORY_ID }}
run: pnpm run publish:local
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v4
with:
path: out
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