web/.github/workflows/build.yml
Workflow config file is invalid. Please check your config file: Line: 1 Column 1: Expected a mapping got sequence Forgejo Actions YAML Schema validation error
tenkuma 7d6a48ab40
Some checks failed
build.yml / Update .github/workflows/build.yml (push) Failing after 0s
Update .github/workflows/build.yml
2026-05-13 22:01:44 -03:00

33 lines
No EOL
963 B
YAML

- name: Publish to forgejo-pages
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"
# Build authenticated clone URL
REPO_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
AUTH_URL="$(echo "$REPO_URL" | sed "s#^https://#https://oauth2:${TOKEN}@#")"
git clone "$AUTH_URL" deploy
cd deploy
git fetch origin forgejo-pages || true
if git ls-remote --exit-code --heads origin forgejo-pages >/dev/null 2>&1; then
git checkout -B forgejo-pages origin/forgejo-pages
else
git checkout --orphan forgejo-pages
git rm -rf . || true
fi
find . -mindepth 1 -maxdepth 1 ! -name .git -exec rm -rf {} +
cp -a ../docs/. .
git add -A
if ! git diff --cached --quiet; then
git commit -m "Deploy ${GITHUB_SHA}"
git push origin forgejo-pages
fi