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