gitscope
← marzneshin / v0.3.0-alpha8 / .github/workflows/dashboard-ci.yml
https://dev.kronoz.win/r/marzneshin.git
.github/workflows/dashboard-ci.yml · YAML
Blame Raw
 1name: Dashboard CI
 2
 3on:
 4
 5  push:
 6    branches: [ "master" ]
 7  pull_request:
 8
 9jobs:
10  build:
11    env: 
12      VITE_BASE_API: /api/
13    runs-on: ubuntu-latest
14    defaults:
15      run:
16        working-directory: ./dashboard
17    steps:
18    - uses: actions/checkout@v4
19
20    - uses: pnpm/action-setup@v3
21      name: Install pnpm
22      with:
23        version: 8
24        run_install: false
25    - name: Get pnpm store directory
26      shell: bash
27      run: |
28        echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV        
29
30    - uses: actions/cache@v3
31      name: Setup pnpm cache
32      with:
33        path: ${{ env.STORE_PATH }}
34        key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
35        restore-keys: |
36          ${{ runner.os }}-pnpm-store-          
37
38    - name: Install dependencies
39      run: pnpm install
40
41    - name: Lint Dashboard
42      run: pnpm lint
43
44    - name: Build Dashboard
45      run: pnpm build --base '/dashboard/'
46
47    - name: Unit Test Dashboard
48      run: pnpm test
49    
50    - name: Upload a Build Artifact
51      uses: actions/upload-artifact@v4.2.0
52      with:
53        name: artifact
54        path: dashboard/dist