-
Notifications
You must be signed in to change notification settings - Fork 11
50 lines (42 loc) · 1.26 KB
/
Copy pathadmin-deploy.yml
File metadata and controls
50 lines (42 loc) · 1.26 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
name: Admin Deployment
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Use Node.js 22
uses: actions/setup-node@v7
with:
node-version: 22
cache: npm
- name: Install Dependencies
run: npm ci
- name: Set Nx SHAs
uses: nrwl/nx-set-shas@v5
- name: Check if admin is affected
id: affected
run: |
PROJECTS=$(npx nx show projects --affected --projects=admin)
if [ -n "$PROJECTS" ]; then
echo "deploy=true" >> "$GITHUB_OUTPUT"
else
echo "deploy=false" >> "$GITHUB_OUTPUT"
echo "admin not affected — skipping deploy"
fi
- name: Build admin
if: steps.affected.outputs.deploy == 'true'
run: npx nx build admin
- name: Deploy Page
if: steps.affected.outputs.deploy == 'true'
uses: cloudflare/wrangler-action@v4
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy dist/apps/admin/browser --project-name=nicobytes-store-admin