From ef3731ba48b0053fed41266d1ac77aa3b9a601ed Mon Sep 17 00:00:00 2001 From: Chris Chen Date: Sat, 20 Jun 2026 22:36:07 -0700 Subject: [PATCH] Update runnder --- .gitea/workflows/ci-cd-nas.yml | 21 +++++++++++++-------- deploy/nas/README.md | 5 +++-- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/ci-cd-nas.yml b/.gitea/workflows/ci-cd-nas.yml index 0193ec5..1f45d6a 100644 --- a/.gitea/workflows/ci-cd-nas.yml +++ b/.gitea/workflows/ci-cd-nas.yml @@ -15,9 +15,10 @@ jobs: runs-on: windows defaults: run: - # Git Bash (bundled with Git for Windows) — needed for `$REGISTRY` and - # the heredoc-style multi-line steps below. - shell: bash + # Windows PowerShell (always present). NOTE: do NOT use `shell: bash` + # here — act_runner in Windows host mode mislocates the generated .sh + # script ("No such file or directory"). PowerShell avoids that bug. + shell: powershell env: REGISTRY: git.golife.love/chrischen steps: @@ -27,17 +28,21 @@ jobs: run: dotnet test API/ROLAC.API.Tests/ROLAC.API.Tests.csproj -c Release - name: Registry login - run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.golife.love -u "${{ secrets.REGISTRY_USER }}" --password-stdin + run: '"${{ secrets.REGISTRY_TOKEN }}" | docker login git.golife.love -u "${{ secrets.REGISTRY_USER }}" --password-stdin' - name: Build images run: | - docker build -t "$REGISTRY/rolac-api:latest" -t "$REGISTRY/rolac-api:${{ github.sha }}" ./API - docker build -t "$REGISTRY/rolac-app:latest" -t "$REGISTRY/rolac-app:${{ github.sha }}" ./APP + docker build -t "$env:REGISTRY/rolac-api:latest" -t "$env:REGISTRY/rolac-api:${{ github.sha }}" ./API + if ($LASTEXITCODE -ne 0) { exit 1 } + docker build -t "$env:REGISTRY/rolac-app:latest" -t "$env:REGISTRY/rolac-app:${{ github.sha }}" ./APP + if ($LASTEXITCODE -ne 0) { exit 1 } - name: Push images run: | - docker push --all-tags "$REGISTRY/rolac-api" - docker push --all-tags "$REGISTRY/rolac-app" + docker push --all-tags "$env:REGISTRY/rolac-api" + if ($LASTEXITCODE -ne 0) { exit 1 } + docker push --all-tags "$env:REGISTRY/rolac-app" + if ($LASTEXITCODE -ne 0) { exit 1 } # Runs on the NAS runner (label `nas`): host Docker socket mounted and # /volume1/docker/rolac bind-mounted at the same path. Deploy ONLY — it just diff --git a/deploy/nas/README.md b/deploy/nas/README.md index 0883f0f..b3da683 100644 --- a/deploy/nas/README.md +++ b/deploy/nas/README.md @@ -52,8 +52,9 @@ installed Docker Desktop + .NET 8 SDK. The workflow's `build-push` job targets - Docker Desktop running, and `docker` on PATH. - .NET 8 SDK on PATH (`dotnet test` runs on this machine). -- **Git for Windows** installed — the job uses `shell: bash` (Git Bash) for the - multi-line `docker build`/`push` steps. +- The `build-push` job uses `shell: powershell`. Do **not** switch it to + `shell: bash`: act_runner in Windows host mode mislocates the generated `.sh` + script (`/bin/bash: .../1.sh: No such file or directory`). PowerShell avoids it. ## One-time setup — NAS (the `nas` runner)