Atualizar .github/workflows/build.yml
Some checks failed
Build Eleventy / build (24.x) (push) Failing after 6s
Some checks failed
Build Eleventy / build (24.x) (push) Failing after 6s
This commit is contained in:
parent
90461e32d5
commit
d1d6f83235
1 changed files with 25 additions and 48 deletions
73
.github/workflows/build.yml
vendored
73
.github/workflows/build.yml
vendored
|
|
@ -2,66 +2,43 @@ name: Build Eleventy
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
paths-ignore:
|
||||||
|
- '/maintenance/**'
|
||||||
|
- '/README.md'
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths-ignore:
|
workflow_dispatch:
|
||||||
- 'maintenance/**'
|
|
||||||
- 'README.md'
|
|
||||||
pull_request:
|
pull_request:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'maintenance/**'
|
- '/maintenance/**'
|
||||||
- 'README.md'
|
- '/README.md'
|
||||||
workflow_dispatch:
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on:
|
runs-on: arch-linux
|
||||||
- arch-linux
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
node-version: [24.x]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Node.js
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: "24"
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies & build
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Build site
|
|
||||||
run: npm run build
|
|
||||||
|
|
||||||
- name: Publish to forgejo-pages
|
|
||||||
if: github.ref == 'refs/heads/main'
|
|
||||||
env:
|
|
||||||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "Forgejo Actions"
|
npm ci
|
||||||
git config --global user.email "actions@localhost"
|
npm run build
|
||||||
|
|
||||||
REPO_URL="https://inspiran.beetal-castor.ts.net/${GITHUB_REPOSITORY}.git"
|
- name: Deploy
|
||||||
AUTH_URL="$(printf '%s\n' "$REPO_URL" | sed "s#^https://#https://oauth2:${TOKEN}@#")"
|
uses: peaceiris/actions-gh-pages@v4
|
||||||
|
with:
|
||||||
git clone "$AUTH_URL" deploy
|
publish_dir: ./docs
|
||||||
cd deploy
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
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
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue