-
-
Notifications
You must be signed in to change notification settings - Fork 64
56 lines (53 loc) · 1.94 KB
/
Continuous_Deployment_Frontend_Dev.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
name: Deploy_Frontend_Dev
on:
push:
branches:
- dev
paths:
- 'client/**'
workflow_dispatch:
defaults:
run:
working-directory: client
jobs:
deploy_frontend_dev:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository Code
uses: actions/checkout@v1
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 12
- name: Rebuild sass
run: npm rebuild node-sass
- name: Install Packages
run: npm install
- name: Setup environment
run: |
echo MAPBOX_TOKEN=${{ secrets.MAPBOX_TOKEN }} > .env
echo MAPBOX_STREETS_URL=${{ secrets.MAPBOX_STREETS_URL }} >> .env
echo MAPBOX_SATELLITE_URL=${{ secrets.MAPBOX_SATELLITE_URL }} >> .env
echo API_URL=${{ secrets.API_URL_DEV }} >> .env
echo REPORT_URL=${{ secrets.REPORT_URL }} >> .env
echo SENTRY_CLIENT_DSN=${{ secrets.SENTRY_CLIENT_DSN }} >> .env
echo MIXPANEL_ENABLED=${{ secrets.MIXPANEL_ENABLED }} >> .env
echo MIXPANEL_TOKEN_PROD=${{ secrets.MIXPANEL_TOKEN_PROD }} >> .env
echo MIXPANEL_TOKEN_DEV=${{ secrets.MIXPANEL_TOKEN_DEV }} >> .env
echo CONTENTFUL_SPACE=${{ secrets.CONTENTFUL_SPACE }} >> .env
echo CONTENTFUL_TOKEN=${{ secrets.CONTENTFUL_TOKEN }} >> .env
echo GITHUB_SHA=${{ github.sha }} >> .env
- name: Build project
run: npm run build
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_CI_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_CI_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Sync Development Build To S3
run: |
aws s3 sync dist s3://${{ secrets.S3_BUCKET_DEV }} --follow-symlinks --delete
- name: Invalidate Cloudfront Cache
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.CDN_DISTRIBUTION_ID_DEV }} --paths "/*"