web/.github/workflows/build.yml
Workflow config file is invalid. Please check your config file: Line: 18 Column 5: Failed to match job-factory: Line: 35 Column 9: Failed to match run-step: Line: 39 Column 14: Failed to parse: got unexpected character '#' while lexing expression, expecting 'a'..'z', 'A'..'Z', '_', '0'..'9', ''', '}', '(', ')', '[', ']', '.', '!', '<', '>', '=', '&', '|', '*', ',', ' ' Line: 35 Column 9: Failed to match regular-step: Line: 39 Column 9: Unknown Property run Line: 18 Column 5: Failed to match workflow-job: Line: 20 Column 5: Unknown Property steps Forgejo Actions YAML Schema validation error
tenkuma dc8894386f
Some checks failed
Build Eleventy / build (push) Failing after 0s
Add support for forgejo-pages
2026-05-13 21:55:58 -03:00

71 lines
No EOL
1.7 KiB
YAML

name: Build Eleventy
on:
push:
branches:
- main
paths-ignore:
- 'maintenance/**'
- 'README.md'
pull_request:
paths-ignore:
- 'maintenance/**'
- 'README.md'
workflow_dispatch:
jobs:
build:
runs-on: arch-linux
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
- name: Install dependencies
run: npm ci
- name: Build site
run: npm run build
- name: Publish to forgejo-pages branch
if: github.ref == 'refs/heads/main'
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "Forgejo Actions"
git config --global user.email "actions@localhost"
# Clone target branch
git clone \
"https://oauth2:${TOKEN}@${{ github.server_url#https:// }}/${{ github.repository }}.git" \
deploy
cd deploy
# Switch to forgejo-pages branch, create if missing
if git show-ref --verify --quiet refs/heads/forgejo-pages; then
git checkout forgejo-pages
else
git checkout --orphan forgejo-pages
git rm -rf .
fi
# Remove old contents
find . -mindepth 1 -maxdepth 1 \
! -name '.git' \
-exec rm -rf {} +
# Copy new build output
cp -r ../docs/. .
# Commit and push if there are changes
git add .
if ! git diff --cached --quiet; then
git commit -m "Deploy from ${GITHUB_SHA}"
git push origin forgejo-pages
fi