Skip to content

Commit

Permalink
Merge pull request #691 from hackforla/656-FRONT-continuousDeployment
Browse files Browse the repository at this point in the history
Frontend Continuous Deployment
  • Loading branch information
adamkendis authored Jun 17, 2020
2 parents ae70977 + b8b2f10 commit 02f2601
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 66 deletions.
66 changes: 0 additions & 66 deletions .github/workflows/Continuous_Delivery.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/Continuous_Deployment_Frontend_Dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: DevDeploy
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: 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 "/*"
59 changes: 59 additions & 0 deletions .github/workflows/Continuous_Deployment_Frontend_Prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: MasterDeploy
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: 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

0 comments on commit 02f2601

Please sign in to comment.