mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-02-22 09:41:26 -08:00
adds comment to trigger build on PR open (#657)
* adds comment to trigger build on PR open * removes uncommented code from GHA files
This commit is contained in:
parent
536a35d6a0
commit
dc8e82b8e2
3 changed files with 9 additions and 53 deletions
40
.github/workflows/deploy_main.yml
vendored
40
.github/workflows/deploy_main.yml
vendored
|
@ -1,9 +1,6 @@
|
|||
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
||||
|
||||
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
||||
|
||||
name: Deploy of main (AWS CDN)
|
||||
on:
|
||||
pull_request:
|
||||
|
@ -26,16 +23,9 @@ jobs:
|
|||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
# If this is just a PR branch, put content in a hash directory. Otherwise, put it in "main"
|
||||
# This variable is used by gatsby-config.js to set a prefixPath
|
||||
- name: Set DESTINATION_FOLDER for main
|
||||
# if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
|
||||
run: |
|
||||
echo "DESTINATION_FOLDER=main" >> $GITHUB_ENV
|
||||
# - name: Set DESTINATION_FOLDER for branch
|
||||
# if: github.event.pull_request.merged != true
|
||||
# run: |
|
||||
# echo "DESTINATION_FOLDER=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV
|
||||
- name: Install
|
||||
run: npm ci
|
||||
- name: Build
|
||||
|
@ -71,22 +61,9 @@ jobs:
|
|||
with:
|
||||
name: J40Static
|
||||
path: ./public
|
||||
# If this is just a PR branch, put content in a hash directory. Otherwise, put it in "main"
|
||||
- name: Set DESTINATION_FOLDER for main
|
||||
# if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
|
||||
run: |
|
||||
echo "DESTINATION_FOLDER=main" >> $GITHUB_ENV
|
||||
# - name: Set DESTINATION_FOLDER for branch
|
||||
# if: github.event.pull_request.merged != true
|
||||
# run: |
|
||||
# echo "DESTINATION_FOLDER=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV
|
||||
# - name: Deploy to Github Pages
|
||||
# uses: JamesIves/github-pages-deploy-action@4.1.0
|
||||
# with:
|
||||
# BRANCH: gh-pages # The branch the action should deploy to.
|
||||
# FOLDER: public # The folder the action should deploy.
|
||||
# TARGET-FOLDER: ${{env.DESTINATION_FOLDER}} # If we're on a PR branch, merge to PR folder
|
||||
# CLEAN: true
|
||||
- name: Configure AWS Credentials
|
||||
uses: aws-actions/configure-aws-credentials@v1
|
||||
with:
|
||||
|
@ -95,17 +72,16 @@ jobs:
|
|||
aws-region: us-east-1
|
||||
- name: Deploy to Geoplatform AWS
|
||||
run: aws s3 sync ./public/ s3://usds-geoplatform-justice40-website/justice40-tool/${{env.DESTINATION_FOLDER}} --acl public-read --delete
|
||||
- name: Invalidate cache on AWS CDNs
|
||||
uses: chetan/invalidate-cloudfront-action@master
|
||||
env:
|
||||
DISTRIBUTION: "ED03LPVC4OXSW" # TODO: set this as ENV var above
|
||||
PATHS: "/*"
|
||||
AWS_REGION: "us-east-1"
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.CLIENT_DEV_AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.CLIENT_DEV_AWS_SECRET_ACCESS_KEY }}
|
||||
# - name: Invalidate cache on AWS CDNs
|
||||
# uses: chetan/invalidate-cloudfront-action@master
|
||||
# env:
|
||||
# DISTRIBUTION: "ED03LPVC4OXSW" # TODO: set this as ENV var above
|
||||
# PATHS: "/*"
|
||||
# AWS_REGION: "us-east-1"
|
||||
# AWS_ACCESS_KEY_ID: ${{ secrets.CLIENT_DEV_AWS_ACCESS_KEY_ID }}
|
||||
# AWS_SECRET_ACCESS_KEY: ${{ secrets.CLIENT_DEV_AWS_SECRET_ACCESS_KEY }}
|
||||
- name: Update PR with deployed URL
|
||||
uses: mshick/add-pr-comment@v1
|
||||
# if: (github.event_name == 'pull_request' && github.event.action == 'opened') || github.event_name == 'push' # Only comment if the PR has been opened or a push has updated it
|
||||
with:
|
||||
message: |
|
||||
**🚢 PR Deployed! 🚢**
|
||||
|
|
20
.github/workflows/deploy_staging.yml
vendored
20
.github/workflows/deploy_staging.yml
vendored
|
@ -7,12 +7,6 @@ on:
|
|||
branches: [main]
|
||||
paths:
|
||||
- "client/**/*"
|
||||
# push:
|
||||
# branches:
|
||||
# - '*' # Run on all updates to PR branches
|
||||
# - '!main' # Do not run on pushes to main
|
||||
# paths:
|
||||
# - 'client/**/*'
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -28,14 +22,7 @@ jobs:
|
|||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
# If this is just a PR branch, put content in a hash directory. Otherwise, put it in "main"
|
||||
# This variable is used by gatsby-config.js to set a prefixPath
|
||||
# - name: Set DESTINATION_FOLDER for main
|
||||
# if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
|
||||
# run: |
|
||||
# echo "DESTINATION_FOLDER=main" >> $GITHUB_ENV
|
||||
- name: Set DESTINATION_FOLDER for branch
|
||||
# if: github.event.pull_request.merged != true
|
||||
run: |
|
||||
echo "DESTINATION_FOLDER=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV
|
||||
- name: Install
|
||||
|
@ -73,13 +60,7 @@ jobs:
|
|||
with:
|
||||
name: J40Static
|
||||
path: ./public
|
||||
# If this is just a PR branch, put content in a hash directory. Otherwise, put it in "main"
|
||||
# - name: Set DESTINATION_FOLDER for main
|
||||
# if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
|
||||
# run: |
|
||||
# echo "DESTINATION_FOLDER=main" >> $GITHUB_ENV
|
||||
- name: Set DESTINATION_FOLDER for branch
|
||||
# if: github.event.pull_request.merged != true
|
||||
run: |
|
||||
echo "DESTINATION_FOLDER=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV
|
||||
- name: Deploy to Github Pages
|
||||
|
@ -99,7 +80,6 @@ jobs:
|
|||
run: aws s3 sync ./public/ s3://usds-geoplatform-justice40-website/justice40-tool/${{env.DESTINATION_FOLDER}} --acl public-read --delete
|
||||
- name: Update PR with deployed URL
|
||||
uses: mshick/add-pr-comment@v1
|
||||
# if: (github.event_name == 'pull_request' && github.event.action == 'opened') || github.event_name == 'push' # Only comment if the PR has been opened or a push has updated it
|
||||
with:
|
||||
# Deploy to S3 for the staging URL
|
||||
message: |
|
||||
|
|
|
@ -72,7 +72,7 @@ const DatasetContainer = () => {
|
|||
},
|
||||
});
|
||||
|
||||
// JSX return value again trigger
|
||||
// JSX return value another build testing
|
||||
return (
|
||||
<div className={`${styles.datasetContainer} desktop:grid-col`}>
|
||||
<div className={'grid-container-desktop-lg'}>
|
||||
|
|
Loading…
Add table
Reference in a new issue