This repository was archived by the owner on Jul 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
75 lines (64 loc) · 2.02 KB
/
main_admin.yml
File metadata and controls
75 lines (64 loc) · 2.02 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
on:
push:
branches: ["main"]
tags:
- "v*"
paths:
- "admin/**"
- ".github/workflows/main_admin.yml"
pull_request:
branches: ["main"]
paths:
- "admin/**"
- ".github/workflows/main_admin.yml"
concurrency:
# Avoid old jobs overlapping with new ones
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
main_admin:
name: Admin Frontend
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Match with VERSION for tag pushes
if: startsWith(github.ref, 'refs/tags/v')
run: |
VERSION=$(cat VERSION)
TAG_VERSION=${GITHUB_REF#refs/tags/v}
if [ "$TAG_VERSION" != "$VERSION" ]; then
echo "::error::Tag version $TAG_VERSION does not match VERSION file $VERSION"
exit 1
fi
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 10
run_install: false
- name: Install Node.js for Admin
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
cache-dependency-path: "./admin/pnpm-lock.yaml"
- name: Install dependencies for Admin
working-directory: "./admin"
run: pnpm install --frozen-lockfile
- name: Build Admin
working-directory: "./admin"
run: |
cp .env.template .env
pnpm run build
- name: Tar Gzip the admin build directory
if: startsWith(github.ref, 'refs/tags/v')
run: tar -czvf admin-${{ github.ref_name }}.tar.gz -C admin/dist .
- name: Upload Admin build artifacts
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: admin-${{ github.ref_name }}.tar.gz
tag: ${{ github.ref }}
# TODO: Temporary overwrite, remove once CI process is hardened
overwrite: true