Skip to content

Deploy Cobudget UI

Deploy Cobudget UI #89

Workflow file for this run

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