This commit is contained in:
Michał Zieliński
2025-09-12 12:05:35 +02:00
parent bb92d535bf
commit ae6d2de4f6

View File

@@ -1,13 +1,8 @@
name: BuildApp
on:
# push:
# branches: [ main ]
# pull_request:
#branches: [ main ]
workflow_dispatch: {}
# (opcjonalnie) ogranicz równoległe runy
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: false
@@ -24,14 +19,11 @@ jobs:
with:
node-version: 20
# Zostawiamy jak u Ciebie, jeśli chcesz można też użyć corepack (pnpm) zamiast global install
- name: Install Angular CLI
run: npm install -g @angular/cli
- name: Install PNPM
run: npm install -g pnpm
# alternatywa:
# run: corepack enable && corepack prepare pnpm@latest --activate
- name: Install dependencies
working-directory: src/Frontend
@@ -45,8 +37,7 @@ jobs:
uses: https://github.com/actions/upload-artifact@v3
with:
name: frontend
path: |
src/Frontend/dist
path: src/Frontend/dist
if-no-files-found: error
retention-days: 7
@@ -124,7 +115,7 @@ jobs:
if-no-files-found: error
retention-days: 7
copy-artifacts:
store-artifacts:
runs-on: ubuntu-latest
needs: [build-frontend, build-backend]
if: success()
@@ -149,15 +140,13 @@ jobs:
cp -r webapi/ "$BUILD_DIR/"
cp -r frontend/ "$BUILD_DIR/"
# Stwórz symlink na "latest"
mkdir -p /runner-cache/builds
ln -sfn "$BUILD_DIR" /runner-cache/builds/latest
# Zapisz metadane
echo "BUILD_TIME=$(date -Iseconds)" > "$BUILD_DIR/build-info.txt"
echo "COMMIT_SHA=${GITHUB_SHA}" >> "$BUILD_DIR/build-info.txt"
echo "BRANCH=${GITHUB_REF_NAME}" >> "$BUILD_DIR/build-info.txt"
echo "BUILD_ID=${GITHUB_RUN_ID}" >> "$BUILD_DIR/build-info.txt"
echo "Build artifacts stored in: $BUILD_DIR"
echo "Build artifacts stored in: $BUILD_DIR"
ls -la "$BUILD_DIR/"