-
Notifications
You must be signed in to change notification settings - Fork 3
80 lines (70 loc) · 2.25 KB
/
deploy.yml
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
name: Deploy
on:
push:
branches:
- develop
- main
- nrel
- lbnl
- pnnl
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Set node version
uses: actions/setup-node@v4
with:
node-version: 16.18.0
- name: Install and Build
run: |
npm install
npm install @angular/cli > /dev/null
npx ng build
- name: Deploy Main Site
uses: JamesIves/[email protected]
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: |
aws s3 sync --delete ./dist s3://${{ secrets.AWS_PROD_BUCKET }}
- 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: |
aws s3 sync --delete ./dist s3://${{ secrets.AWS_STAGING_BUCKET }}
- name: Deploy NREL
uses: JamesIves/[email protected]
if: github.ref == 'refs/heads/nrel'
with:
repository-name: BuildingEnergyTools/tools-website-nrel
branch: gh-pages
folder: dist
token: ${{ secrets.DEPLOY_STAGING_KEY }}
- name: Deploy LBNL
uses: JamesIves/[email protected]
if: github.ref == 'refs/heads/lbnl'
with:
repository-name: BuildingEnergyTools/tools-website-lbnl
branch: gh-pages
folder: dist
token: ${{ secrets.DEPLOY_STAGING_KEY }}
- name: Deploy PNNL
uses: JamesIves/[email protected]
if: github.ref == 'refs/heads/pnnl'
with:
repository-name: BuildingEnergyTools/tools-website-pnnl
branch: gh-pages
folder: dist
token: ${{ secrets.DEPLOY_STAGING_KEY }}