act_runner staví workspace do /root/.cache/act/..., a quarto v cestě obsahující skrytý adresář nenajde žádné vstupní soubory: vyrobí prázdný _site a skončí s kódem 0. Ověřeno lokálně stejnou verzí quarta. Checkout i render proto probíhají v /tmp/quarto-build-<run_id>. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6215de1d35
commit
e9a20baf93
1 file changed
+15
-16
@@ -8,6 +8,10 @@ on:
|
||||
env:
|
||||
QUARTO_VERSION: "1.10.18"
|
||||
GITEA_HOST: gitea.spacilovi.eu
|
||||
# Pozor: nesmí být pod skrytým adresářem. Workspace runneru je
|
||||
# /root/.cache/act/... a quarto v cestě se skrytou složkou nenajde
|
||||
# žádné vstupní soubory – vyrobí prázdný _site a skončí s kódem 0.
|
||||
BUILD_DIR: /tmp/quarto-build-${{ github.run_id }}
|
||||
|
||||
jobs:
|
||||
build-deploy:
|
||||
@@ -19,8 +23,9 @@ jobs:
|
||||
TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
run: |
|
||||
set -e
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
find . -mindepth 1 -maxdepth 1 -exec rm -rf {} +
|
||||
rm -rf "$BUILD_DIR"
|
||||
mkdir -p "$BUILD_DIR"
|
||||
cd "$BUILD_DIR"
|
||||
git init -q .
|
||||
git fetch --depth 1 \
|
||||
"https://x-access-token:${TOKEN}@${GITEA_HOST}/${GITHUB_REPOSITORY}.git" \
|
||||
@@ -41,17 +46,8 @@ jobs:
|
||||
- name: Render
|
||||
run: |
|
||||
set -e
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
QUARTO="$HOME/opt/quarto-${QUARTO_VERSION}/bin/quarto"
|
||||
echo "pwd=$(pwd)"
|
||||
ls -la
|
||||
"$QUARTO" --version
|
||||
echo "--- quarto check ---"
|
||||
"$QUARTO" check 2>&1 | head -40 || echo "check skončil s kódem $?"
|
||||
echo "--- render (debug) ---"
|
||||
"$QUARTO" render --log-level debug 2>&1 | tail -60 || echo "render skončil s kódem $?"
|
||||
echo "--- obsah _site ---"
|
||||
find _site -maxdepth 2 2>/dev/null | head -30
|
||||
cd "$BUILD_DIR"
|
||||
"$HOME/opt/quarto-${QUARTO_VERSION}/bin/quarto" render
|
||||
# pojistka: prázdný build nesmí přepsat publikovaný web
|
||||
test -f _site/index.html
|
||||
|
||||
@@ -60,8 +56,7 @@ jobs:
|
||||
TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
run: |
|
||||
set -e
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
# pojistka: bez index.html v _site se nepublikuje nic
|
||||
cd "$BUILD_DIR"
|
||||
test -f _site/index.html
|
||||
REMOTE="https://x-access-token:${TOKEN}@${GITEA_HOST}/${GITHUB_REPOSITORY}.git"
|
||||
WT="/tmp/gh-pages-${GITHUB_RUN_ID}"
|
||||
@@ -84,7 +79,7 @@ jobs:
|
||||
|
||||
# zahodit staré soubory (kromě .git) a nakopírovat nový build
|
||||
find . -mindepth 1 -maxdepth 1 ! -name .git -exec rm -rf {} +
|
||||
cp -a "${GITHUB_WORKSPACE}/_site/." .
|
||||
cp -a "${BUILD_DIR}/_site/." .
|
||||
touch .nojekyll
|
||||
|
||||
git add -A
|
||||
@@ -94,3 +89,7 @@ jobs:
|
||||
fi
|
||||
git commit -q -m "Built site for gh-pages (${GITHUB_SHA::7})"
|
||||
git push "$REMOTE" HEAD:gh-pages
|
||||
|
||||
- name: Cleanup
|
||||
if: always()
|
||||
run: rm -rf "$BUILD_DIR"
|
||||
Reference in new issue
Block a user