-
Notifications
You must be signed in to change notification settings - Fork 19
60 lines (56 loc) · 1.98 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
name: Deploy Cobudget UI
on:
watch:
types: [started]
push:
branches:
- develop
- master
paths-ignore:
- 'api/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: build
uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '8'
- run: |
cd ui
npm install --silent
- name: deploy staging
if: github.ref == 'refs/heads/develop'
run: |
cd ui || find .
npm run build
npm run sentry
aws s3 sync ./build/ s3://${AWS_S3_BUCKET}/ --acl public-read --cache-control max-age=86400 --delete
aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths "/*"
env:
AWS_S3_BUCKET: ${{ secrets.AWS_STAGING_BUCKET_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
DISTRIBUTION_ID: ${{ secrets.STAGING_DISTRIBUTION_ID }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
APP_ENV: staging
NODE_ENV: production
- name: deploy production
if: github.ref == 'refs/heads/master'
run: |
cd ui || find .
npm run build
npm run sentry
aws s3 sync ./build/ s3://${AWS_S3_BUCKET}/ --acl public-read --cache-control max-age=86400 --delete
aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths "/*"
env:
AWS_S3_BUCKET: ${{ secrets.AWS_PRODUCTION_BUCKET_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
DISTRIBUTION_ID: ${{ secrets.DISTRIBUTION_ID }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
APP_ENV: production
NODE_ENV: production