-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (68 loc) · 2.24 KB
/
Copy pathstatic.yml
File metadata and controls
70 lines (68 loc) · 2.24 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
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
on:
# Deploy when code is pushed to PROD (production branch)
push:
branches: ["PROD"]
# Validate PRs targeting PROD (build only, no deploy)
pull_request:
branches: ["PROD"]
types: [opened, synchronize, reopened]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Permissions required for Pages deployment
permissions:
contents: read
pages: write
id-token: write
# Optional: opt in to Node 24 runtime for JS actions
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
# Keep only one Pages workflow active at a time
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Build job runs on both push and pull_request
build:
runs-on: ubuntu-latest
steps:
# Checkout repository code
- name: Checkout
uses: actions/checkout@v5
# Prepare static dataset used by the frontend
- name: Sync static Fabric IQ data
run: node scripts/sync-static-data.js
# Inject backend URL into public/config.js for Pages runtime
- name: Inject Azure API URL for GitHub Pages
run: node scripts/inject-config.js
env:
AZURE_API_URL: ${{ secrets.AZURE_API_URL }}
# Upload built static site artifact from /public
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "./public"
# Deploy job runs only on push/manual events (not PR validation runs)
deploy:
if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
# Ensure Pages is configured/enabled
- name: Setup Pages
uses: actions/configure-pages@v5
with:
enablement: true
# Deploy artifact to GitHub Pages
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
# Friendly success logs
- name: Log Deployment Details
run: |
echo "🎉 AgriValue AI Terminal v3.5 successfully deployed to GitHub Pages!"
echo "👉 Check your live link: https://cdm227.github.io/AgriValue-Tracker"