-
Notifications
You must be signed in to change notification settings - Fork 4
68 lines (59 loc) · 2.07 KB
/
Copy pathdeploy.yml
File metadata and controls
68 lines (59 loc) · 2.07 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
name: Deploy
on:
push:
branches:
- develop
- main
- nrel
- lbnl
- pnnl
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v6
- name: Set node version
uses: actions/setup-node@v6
with:
node-version: 16.18.0
- name: Install and Build
run: |
npm ci
npm install @angular/cli > /dev/null
# Ensure consistent output hashing for runtime files
npx ng build --output-hashing=bundles
- name: Deploy Main Site
uses: JamesIves/github-pages-deploy-action@v4.7.4
if: github.ref == 'refs/heads/main'
with:
branch: gh-pages
folder: dist
- name: Deploy S3 Production
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
AWS_REGION: us-east-1
if: github.ref == 'refs/heads/main'
run: |
# Deploy HTML files with no-cache to prevent stale references
aws s3 sync --delete ./dist s3://${{ secrets.AWS_PROD_BUCKET }} \
--exclude "*" --include "*.html" \
--cache-control "no-cache, no-store, must-revalidate"
# Deploy all other files normally
aws s3 sync ./dist s3://${{ secrets.AWS_PROD_BUCKET }} \
--exclude "*.html"
- name: Deploy S3 Staging
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
AWS_REGION: us-east-1
if: github.ref == 'refs/heads/develop'
run: |
# Deploy HTML files with no-cache to prevent stale references
aws s3 sync --delete ./dist s3://${{ secrets.AWS_STAGING_BUCKET }} \
--exclude "*" --include "*.html" \
--cache-control "no-cache, no-store, must-revalidate"
# Deploy all other files normally
aws s3 sync ./dist s3://${{ secrets.AWS_STAGING_BUCKET }} \
--exclude "*.html"