-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (72 loc) · 2.3 KB
/
Copy pathdeploy-frontend.yml
File metadata and controls
83 lines (72 loc) · 2.3 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
name: Deploy Frontend
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
inputs:
skip-cache:
description: 'Skip deployment cache and force redeploy'
type: boolean
default: false
permissions:
contents: read
statuses: write
id-token: write
pull-requests: write
concurrency:
group: deploy-frontend-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
name: Build
steps:
- name: Checkout repository
uses: actions/checkout@v4
# - name: Setup node
# uses: ./.github/actions/setup-node
# with:
# NODEJS_VERSION: '22'
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
working-directory: frontend
run: npm ci
- name: Compute source hash
id: source-hash
run: echo "hash=$(find frontend/src frontend/public frontend/package.json frontend/next.config.js -type f 2>/dev/null | sort | xargs sha256sum | sha256sum | cut -d' ' -f1)" >> "$GITHUB_OUTPUT"
- name: Cache build
id: cache-build
uses: actions/cache@v4
with:
path: frontend/out
key: build-${{ steps.source-hash.outputs.hash }}
- name: Build app
if: steps.cache-build.outputs.cache-hit != 'true'
#run: yarn workspace @claude-certificate/frontend build
working-directory: frontend
run: npm run build
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: frontend-build
path: frontend/out
retention-days: 1
deploy:
needs: build
name: Deploy
uses: ./.github/workflows/deploy-to-triangle.yml
with:
dotns-domain: ${{ github.event_name == 'push' && 'claude-certificate26.dot' || format('{0}-{1}00.dot', github.event.repository.name, github.event.pull_request.head.ref) }}
artifact-name: frontend-build
skip-cache: ${{ inputs.skip-cache || false }}
secrets:
mnemonic: ${{ secrets.MNEMONIC || 'bottom drive obey lake curtain smoke basket hold race lonely fit walk' }}