-
Notifications
You must be signed in to change notification settings - Fork 81
90 lines (76 loc) · 2.77 KB
/
build_deploy.yml
File metadata and controls
90 lines (76 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Copyright (c) Helio Chissini de Castro, 2023. Part of the SW360 Frontend Project.
#
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
# License-Filename: LICENSE
name: Build
on:
pull_request:
workflow_dispatch:
permissions:
contents: read
checks: write
pull-requests: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
with:
egress-policy: audit
- name: Checkout source code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: pnpm-setup
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
with:
version: 8
- name: Setup Node
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: '24'
cache: 'pnpm'
- uses: actions/cache@v5
with:
# See here for caching with `yarn`, `bun` or other package managers https://github.com/actions/cache/blob/main/examples.md or you can leverage caching with actions/setup-node https://github.com/actions/setup-node
path: |
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- name: 📦 Install dependencies
shell: bash
run: |
pnpm i
- name: Run linting
shell: bash
run: |
pnpm biome ci --reporter=github | tee biome_output.txt
# Append output to GitHub summary
{
echo "## 🧹 Biome Report"
echo ""
echo '```'
cat biome_output.txt
echo '```'
} >> $GITHUB_STEP_SUMMARY
- name: Run build
shell: bash
run: |
pnpm build --experimental-analyze --turbo --profile
- name: Create Deploy Tarball
shell: bash
run: |
pnpm pack --pack-destination dist
- name: Create GH release
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
if: startsWith(github.ref, 'refs/tags/v')
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
dist/sw360-frontend-*.tgz