From a66743df1506c867d8d6580e647e7098cb9ef6cd Mon Sep 17 00:00:00 2001 From: gitea-actions Date: Thu, 13 Aug 2026 18:41:43 +0200 Subject: [PATCH] =?UTF-8?q?ci:=20nespol=C3=A9hat=20na=20Node.js=20na=20run?= =?UTF-8?q?neru?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Runner běží v host módu bez Node.js, takže actions/checkout selhal na "Cannot find: node in PATH". Checkout se dělá přímo gitem a quarto se volá plnou cestou, aby nebyl potřeba ani GITHUB_PATH. Co-Authored-By: Claude Opus 5 --- .gitea/workflows/publish.yml | 44 ++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml index b442d8d..10547e4 100644 --- a/.gitea/workflows/publish.yml +++ b/.gitea/workflows/publish.yml @@ -7,45 +7,61 @@ on: env: QUARTO_VERSION: "1.10.18" + GITEA_HOST: gitea.spacilovi.eu jobs: build-deploy: + # runner běží v host módu bez Node.js, proto žádné JS akce (actions/checkout apod.) runs-on: homelab steps: - name: Checkout - uses: actions/checkout@v4 + env: + TOKEN: ${{ secrets.GITEA_TOKEN }} + run: | + set -e + cd "$GITHUB_WORKSPACE" + find . -mindepth 1 -maxdepth 1 -exec rm -rf {} + + git init -q . + git fetch --depth 1 \ + "https://x-access-token:${TOKEN}@${GITEA_HOST}/${GITHUB_REPOSITORY}.git" \ + "$GITHUB_REF_NAME" + git checkout -q FETCH_HEAD - name: Install Quarto run: | set -e - curl -sSL -o /tmp/quarto.tar.gz \ - "https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-amd64.tar.gz" - mkdir -p "$HOME/opt" - tar -xzf /tmp/quarto.tar.gz -C "$HOME/opt" - echo "$HOME/opt/quarto-${QUARTO_VERSION}/bin" >> "$GITHUB_PATH" + if [ ! -x "$HOME/opt/quarto-${QUARTO_VERSION}/bin/quarto" ]; then + curl -sSL -o /tmp/quarto.tar.gz \ + "https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-amd64.tar.gz" + mkdir -p "$HOME/opt" + tar -xzf /tmp/quarto.tar.gz -C "$HOME/opt" + rm -f /tmp/quarto.tar.gz + fi - name: Render - run: quarto render + run: "$HOME/opt/quarto-${QUARTO_VERSION}/bin/quarto render" - name: Deploy to gh-pages env: TOKEN: ${{ secrets.GITEA_TOKEN }} run: | set -e - REMOTE="https://x-access-token:${TOKEN}@gitea.spacilovi.eu/${GITHUB_REPOSITORY}.git" + REMOTE="https://x-access-token:${TOKEN}@${GITEA_HOST}/${GITHUB_REPOSITORY}.git" + WT="/tmp/gh-pages-${GITHUB_RUN_ID}" + trap 'rm -rf "$WT"' EXIT - git config --global user.name "gitea-actions" - git config --global user.email "gitea-actions@spacilovi.eu" + git config user.name "gitea-actions" + git config user.email "gitea-actions@spacilovi.eu" # pracovní kopie gh-pages (zachová dosavadní historii větve) if git ls-remote --exit-code "$REMOTE" gh-pages >/dev/null 2>&1; then git fetch "$REMOTE" gh-pages - git worktree add /tmp/gh-pages FETCH_HEAD - cd /tmp/gh-pages + git worktree add "$WT" FETCH_HEAD + cd "$WT" git checkout -B gh-pages else - mkdir -p /tmp/gh-pages - cd /tmp/gh-pages + mkdir -p "$WT" + cd "$WT" git init -q -b gh-pages fi