generated from toggle-corp/base-react-app
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (93 loc) · 3.56 KB
/
ci.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: CI
on:
push:
branches:
- release
- feature/new-staging-prod-deployment-pipeline
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
lint_test:
name: 🚴 Lint + Test 🚴
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '17.x'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile --prefer-offline
- name: 🤞 Run Lint 🧪
run: yarn lint
# - name: 🤞 Run Test 🧪
# run: yarn test
run_build:
name: 🚴 Build 🚴
needs: lint_test
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '17.x'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile --prefer-offline
- name: 🤞 Run Build 🧪 (PREVIEW -> Helix-STAGING)
uses: ./.github/actions/run_build
with:
REACT_APP_ENVIRONMENT: preview
BUILD_OUTPUT_DIR: build-preview-helix-staging/
UPLOAD_ARTIFACT_NAME: helix-staging-preview-idmc-website-components
# Overwrite
REACT_APP_DATA_RELEASE: PRE_RELEASE
REACT_APP_DRUPAL_ENDPOINT: https://staging.internal-displacement.org
REACT_APP_HELIX_GRAPHQL_ENDPOINT: https://helix-tools-api-staging.idmcdb.org/graphql
REACT_APP_HELIX_REST_ENDPOINT: https://helix-tools-api-staging.idmcdb.org/external-api/
- name: 🤞 Run Build 🧪 (PREVIEW -> Helix-PROD)
uses: ./.github/actions/run_build
with:
REACT_APP_ENVIRONMENT: preview
BUILD_OUTPUT_DIR: build-preview/
UPLOAD_ARTIFACT_NAME: preview-idmc-website-components
# Overwrite
REACT_APP_DATA_RELEASE: PRE_RELEASE
REACT_APP_DRUPAL_ENDPOINT: https://staging.internal-displacement.org
- name: 🤞 Run Build 🧪 (RELEASE/PROD)
uses: ./.github/actions/run_build
with:
REACT_APP_ENVIRONMENT: release
BUILD_OUTPUT_DIR: build-release/
UPLOAD_ARTIFACT_NAME: release-idmc-website-components
helix_staging_preview_deploy:
name: Deploy (PREVIEW -> Helix-STAGING)
needs: run_build
uses: ./.github/workflows/aws_deploy.yml
with:
GH_ENVIRONMENT_NAME: preview
GH_ENVIRONMENT_URL: https://preview-website-components.idmcdb.org
ARTIFACT_NAME: helix-staging-preview-idmc-website-components
S3_BUCKET: ${{ secrets.PREVIEW_AWS_S3_BUCKET }}
DISTRIBUTION: ${{ secrets.PREVIEW_AWS_CLOUDFRONT_DISTRIBUTION }}
preview_deploy:
name: Deploy (PREVIEW -> Helix-PROD)
needs: helix_staging_preview_deploy
uses: ./.github/workflows/aws_deploy.yml
with:
GH_ENVIRONMENT_NAME: preview
GH_ENVIRONMENT_URL: https://preview-website-components.idmcdb.org
ARTIFACT_NAME: preview-idmc-website-components
S3_BUCKET: ${{ secrets.PREVIEW_AWS_S3_BUCKET }}
DISTRIBUTION: ${{ secrets.PREVIEW_AWS_CLOUDFRONT_DISTRIBUTION }}
release_deploy:
name: Deploy (Release/Prod)
uses: ./.github/workflows/aws_deploy.yml
with:
GH_ENVIRONMENT_NAME: release
GH_ENVIRONMENT_URL: https://release-website-components.idmcdb.org
ARTIFACT_NAME: release-idmc-website-components
S3_BUCKET: ${{ secrets.RELEASE_AWS_S3_BUCKET }}
DISTRIBUTION: ${{ secrets.RELEASE_AWS_CLOUDFRONT_DISTRIBUTION }}