Skip to content

Merge pull request #1 from codeuzhub/feat/lang #4

Merge pull request #1 from codeuzhub/feat/lang

Merge pull request #1 from codeuzhub/feat/lang #4

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Set Eleventy path prefix
run: |
REPO_NAME="${GITHUB_REPOSITORY#*/}"
if [[ "$REPO_NAME" == *.github.io ]]; then
echo "ELEVENTY_PATH_PREFIX=/" >> "$GITHUB_ENV"
else
echo "ELEVENTY_PATH_PREFIX=/${REPO_NAME}/" >> "$GITHUB_ENV"
fi
- run: npm ci
- run: npm run build:css
- run: npx eleventy --pathprefix="$ELEVENTY_PATH_PREFIX"
- run: npm run check
- uses: actions/upload-pages-artifact@v3
with:
path: _site
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4