Skip to content

Commit

Permalink
Merge pull request #40 from CityOfLosAngeles/development
Browse files Browse the repository at this point in the history
major data update
  • Loading branch information
angelamhkim committed Nov 25, 2021
2 parents 6100488 + 3de556e commit e5cb9be
Show file tree
Hide file tree
Showing 128 changed files with 2,553 additions and 1,621 deletions.
37 changes: 23 additions & 14 deletions .github/workflows/BuildNDeployDev.yml
@@ -1,27 +1,29 @@
name: Build and Deploy Development Data

on: # run this workflow when a push has been made to `Jekyll-Alf` branch
on: # run this workflow when a push has been made to development branch
push:
branches:
- development


jobs:
deploy:
runs-on: ubuntu-20.04
env:
# Service Account info to trigger open-sdg-site-starter workflow
PAT_USERNAME: ${{ secrets.PAT_USERNAME }}
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
CLOUDFRONT_DIST_ID: ${{ secrets.CDN_DISTRIBUTION_ID_DEV }}
steps:
###########################################################################################################
# This is the CI portion
###########################################################################################################
- name: Checkout repo
uses: actions/checkout@v2



###########################################################################################################
# This is the CD portion
###########################################################################################################


- name: Setup Python
uses: actions/setup-python@v1 # sets up python in our environment
with:
Expand All @@ -31,15 +33,12 @@ jobs:
- name: Install Python dependencies requirements
run: pip3 install -r scripts/requirements.txt



- name: Build site data
run: python3 scripts/build_data.py

- name: Install AWS CLI
run: pip3 install awscli --upgrade --user # install the cli with upgrade to any requirements and into the subdir of the user



- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1 # use the official GitHub Action from AWS to setup credentials
with:
Expand All @@ -48,12 +47,22 @@ jobs:
aws-region: ${{ secrets.AWS_REGION }}
mask-aws-account-id: true


- name: Push Contents to S3 # push the current working directory to the S3 bucket
run: aws s3 sync _site/ s3://${{ secrets.S3_BUCKET_NAME_DEV }} --exclude ".git/*" --exclude ".github/*" --delete # have the bucket have the same content in the repo & exclude the git related directories.

- name: Invalidate CloudFront Cache # Invalidate the CloudFront Distribution Cache to get contents from the S3 bucket
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CDN_DISTRIBUTION_ID_DEV }} --paths "/*"



run: aws cloudfront create-invalidation --distribution-id "$CLOUDFRONT_DIST_ID" --paths "/*"

- name: Check Invalidation is Complete
run: ./scripts/check_invalidations.sh

- name: Trigger open-sdg-site-starter workflow
run: |
curl \
-X POST \
-u "$PAT_USERNAME:$PAT_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
-H "Content-Type: application/json" \
https://api.github.com/repos/CityOfLosAngeles/open-sdg-site-starter/dispatches \
-d '{"event_type":"dev_triggered_from_open-sdg-data-starter"}'
39 changes: 23 additions & 16 deletions .github/workflows/BuildNDeployProd.yml
@@ -1,46 +1,44 @@
name: Build and Deploy Production Data

on: # run this workflow when a push has been made to `Jekyll-Alf` branch
on: # run this workflow when a push has been made to production branch
push:
branches:
- production


jobs:
deploy:
runs-on: ubuntu-20.04
env:
# Service Account info to trigger open-sdg-site-starter workflow
PAT_USERNAME: ${{ secrets.PAT_USERNAME }}
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
CLOUDFRONT_DIST_ID: ${{ secrets.CDN_DISTRIBUTION_ID_PROD }}
steps:
###########################################################################################################
# This is the CI portion
###########################################################################################################
- name: Checkout repo
uses: actions/checkout@v2



###########################################################################################################
# This is the CD portion
###########################################################################################################

#- uses: actions/checkout@v1 # checks out the code in the repository

- name: Setup Python
uses: actions/setup-python@v1 # sets up python in our environment
with:
python-version: '3.x' # install python version 3.x, default architecture is x64


# this Action should follow steps to set up Python build environment
- name: Install Python dependencies requirements
run: pip3 install -r scripts/requirements.txt




- name: Build site data
run: python3 scripts/build_data.py

- name: Install AWS CLI
run: pip3 install awscli --upgrade --user # install the cli with upgrade to any requirements and into the subdir of the user


- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1 # use the official GitHub Action from AWS to setup credentials
with:
Expand All @@ -49,12 +47,21 @@ jobs:
aws-region: ${{ secrets.AWS_REGION }}
mask-aws-account-id: true


- name: Push Contents to S3 # push the current working directory to the S3 bucket
run: aws s3 sync _site/ s3://${{ secrets.S3_BUCKET_NAME_PROD }} --exclude ".git/*" --exclude ".github/*" --delete # have the bucket have the same content in the repo & exclude the git related directories.

- name: Invalidate CloudFront Cache # Invalidate the CloudFront Distribution Cache to get contents from the S3 bucket
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CDN_DISTRIBUTION_ID_PROD }} --paths "/*"



run: aws cloudfront create-invalidation --distribution-id "$CLOUDFRONT_DIST_ID" --paths "/*"

- name: Check Invalidation is Complete
run: ./scripts/check_invalidations.sh

- name: Trigger open-sdg-site-starter workflow
run: |
curl \
-X POST \
-u "$PAT_USERNAME:$PAT_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
-H "Content-Type: application/json" \
https://api.github.com/repos/CityOfLosAngeles/open-sdg-site-starter/dispatches \
-d '{"event_type":"prod_triggered_from_open-sdg-data-starter"}'
4 changes: 3 additions & 1 deletion _prose.yml
Expand Up @@ -85,7 +85,7 @@ prose:
- name: "national_target_line"
field:
element: text
label: "Target line"
label: "Local target"
scope: national
- name: "national_geographical_coverage"
field:
Expand Down Expand Up @@ -153,6 +153,8 @@ prose:
value: 'New'
- name: 'Non-Statistical'
value: 'Non-Statistical'
- name: 'Proxy'
value: 'Proxy'
scope: national
######### Data Info #########
- name: "reporting_status"
Expand Down
23 changes: 22 additions & 1 deletion data/indicator_1-1-1.csv
Expand Up @@ -145,4 +145,25 @@ Year,Age,Gender,Race,Education Attainment,Employment Status,Units,Value
2018,,,,Bachelor's Degree or Higher,,Percent by Education,3.5
2018,,,,,,Percentage by Employment,6.8
2018,,,,,Employed (full-time),Percentage by Employment,0.5
2018,,,,,Unemployed,Percentage by Employment,20.1
2018,,,,,Unemployed,Percentage by Employment,20.1
2019,,,,,,Percent by Age,7.3
2019,Under 18 years,,,,,Percent by Age,10.1
2019,18 to 64 years,,,,,Percent by Age,7.0
2019,65 years and over,,,,,Percent by Age,4.8
2019,,,,,,Percent by Gender,7.3
2019,,Male,,,,Percent by Gender,6.7
2019,,Female,,,,Percent by Gender,7.9
2019,,,,,,Percent by Race,7.3
2019,,,White,,,Percent by Race,6.3
2019,,,Black or African American,,,Percent by Race,12.1
2019,,,American Indian and Alaska Native,,,Percent by Race,8.0
2019,,,Asian,,,Percent by Race,7.3
2019,,,Native Hawaiian and Other Pacific Islander,,,Percent by Race,11.7
2019,,,Hispanic or Latino origin (any race),,,Percent by Race,7.9
2019,,,,,,Percent by Education,7.3
2019,,,,Less than High School,,Percent by Education,9.2
2019,,,,High School Graduate,,Percent by Education,6.8
2019,,,,Bachelor's Degree or Higher,,Percent by Education,3.4
2019,,,,,,Percentage by Employment,7.3
2019,,,,,Employed (full-time),Percentage by Employment,0.7
2019,,,,,Unemployed,Percentage by Employment,21.6

0 comments on commit e5cb9be

Please sign in to comment.