Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend Continuous Deployment #691

Merged
merged 6 commits into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 0 additions & 66 deletions .github/workflows/Continuous_Delivery.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/Continuous_Deployment_Frontend_Dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: DevDeployCI
on:
push:
branches:
- dev

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository Code
uses: actions/checkout@v1
- name: Rebuild sass
run: npm rebuild node-sass
- name: Install Packages
run: npm install
- name: Setup environment
run: |
echo REACT_APP_MAPBOX_TOKEN=${{ secrets.MAPBOX_TOKEN }} > .env
echo DB_URL=${{ secrets.SERVER_URL_DEV }} >> .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 GITHUB_SHA=${{ github.sha }} >> .env
- name: Build project
run: npm run build
- name: Run Tests
run: export CI=true && npm run test -- --coverage
- 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 "/*"
61 changes: 61 additions & 0 deletions .github/workflows/Continuous_Deployment_Frontend_Prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: MasterDeployCI
on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository Code
uses: actions/checkout@v1
- name: Rebuild sass
run: npm rebuild node-sass
- name: Install Packages
run: npm install
- name: Setup environment
run: |
echo REACT_APP_MAPBOX_TOKEN=${{ secrets.MAPBOX_TOKEN }} > .env
echo DB_URL=${{ secrets.DB_URL }} >> .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 GITHUB_SHA=${{ github.sha }} >> .env
- name: Build project
run: npm run build
- name: Run Tests
run: export CI=true && npm run test -- --coverage
- 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 Production Build To S3
run: |
aws s3 sync dist s3://${{ secrets.S3_BUCKET_PROD }} --follow-symlinks --delete
- name: Invalidate Cloudfront Cache
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.CDN_DISTRIBUTION_ID_PROD }} --paths "/*"

# - name: Terraform Init
# uses: hashicorp/terraform-github-actions@master
# with:
# tf_actions_version: ${{ env.tf_version }}
# tf_actions_working_dir: ${{ env.tf_working_dir }}
# tf_actions_subcommand: 'init'
# - name: Terraform Validate
# uses: hashicorp/terraform-github-actions@master
# with:
# tf_actions_version: ${{ env.tf_version }}
# tf_actions_working_dir: ${{ env.tf_working_dir }}
# tf_actions_subcommand: 'validate'
# tf_actions_comment: true
# - name: Terraform Apply
# uses: hashicorp/terraform-github-actions@master
# with:
# tf_actions_version: ${{ env.tf_version }}
# tf_actions_working_dir: ${{ env.tf_working_dir }}
# tf_actions_subcommand: 'apply'
# tf_actions_comment: true