Fix Gitea pipeline workspace handling
CI - Build & Verify / Build, Typecheck & Hygiene (push) Successful in 59s
CI - Build & Verify / Deploy to award.noveria.net (push) Successful in 1m7s

This commit is contained in:
AzuTear
2026-06-26 18:37:50 +02:00
parent 3499ad0df5
commit ca69cdb0de
+20 -17
View File
@@ -53,23 +53,28 @@ jobs:
exit 1
fi
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
- name: Backend build
run: |
set -euo pipefail
docker run --rm \
-v "${{ gitea.workspace }}:/workspace" \
-w /workspace \
mcr.microsoft.com/dotnet/sdk:8.0-alpine \
sh -lc 'dotnet restore Backend/Backend.csproj && dotnet build Backend/Backend.csproj --no-restore --configuration Release'
dotnet restore Backend/Backend.csproj
dotnet build Backend/Backend.csproj --no-restore --configuration Release
- name: Frontend build
run: |
set -euo pipefail
docker run --rm \
-v "${{ gitea.workspace }}:/workspace" \
-w /workspace/frontend \
node:24-alpine \
sh -lc 'npm ci && npm run build'
npm ci
npm run build
working-directory: frontend
deploy:
name: Deploy to award.noveria.net
@@ -77,8 +82,8 @@ jobs:
needs: verify
timeout-minutes: 30
if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && gitea.ref == 'refs/heads/main')
gitea.event_name == 'workflow_dispatch' ||
(gitea.event_name == 'push' && gitea.ref == 'refs/heads/main')
env:
DEPLOY_PATH: /home/projekte_bao/vtuber-awards
DEPLOY_APP_PATH: /home/projekte_bao/vtuber-awards/app
@@ -114,23 +119,21 @@ jobs:
- name: Sync code to production app directory
run: |
set -euo pipefail
docker run --rm \
-v "${{ gitea.workspace }}:/src:ro" \
tar --exclude=.git -cf - . | docker run --rm -i \
-v "${DEPLOY_APP_PATH}:/dest" \
alpine:latest \
sh -lc '
set -e
dest_owner="$(stat -c "%u:%g" /dest)"
find /dest -mindepth 1 -maxdepth 1 ! -name .git -exec rm -rf {} +
cd /src
find . -mindepth 1 -maxdepth 1 ! -name .git -exec cp -R {} /dest/ \;
tar -xf - -C /dest
chown -R "$dest_owner" /dest
'
- name: Build Docker images
run: |
set -euo pipefail
no_cache="${{ github.event_name == 'workflow_dispatch' && inputs.no_cache || false }}"
no_cache="${{ gitea.event_name == 'workflow_dispatch' && inputs.no_cache || false }}"
build_args=""
if [ "$no_cache" = "true" ]; then
build_args="--no-cache"