From dc8e82b8e2689b91504949ce48d22ed3e658d3d8 Mon Sep 17 00:00:00 2001 From: Vim <86254807+vim-usds@users.noreply.github.com> Date: Fri, 10 Sep 2021 11:37:58 -0700 Subject: [PATCH] adds comment to trigger build on PR open (#657) * adds comment to trigger build on PR open * removes uncommented code from GHA files --- .github/workflows/deploy_main.yml | 40 ++++--------------- .github/workflows/deploy_staging.yml | 20 ---------- .../src/components/DatasetContainer/index.tsx | 2 +- 3 files changed, 9 insertions(+), 53 deletions(-) diff --git a/.github/workflows/deploy_main.yml b/.github/workflows/deploy_main.yml index 6e9401ae..e6612f0d 100644 --- a/.github/workflows/deploy_main.yml +++ b/.github/workflows/deploy_main.yml @@ -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! 🚢** diff --git a/.github/workflows/deploy_staging.yml b/.github/workflows/deploy_staging.yml index 435e2ab3..9f70f4d3 100644 --- a/.github/workflows/deploy_staging.yml +++ b/.github/workflows/deploy_staging.yml @@ -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: | diff --git a/client/src/components/DatasetContainer/index.tsx b/client/src/components/DatasetContainer/index.tsx index 47d66365..3f632bfe 100644 --- a/client/src/components/DatasetContainer/index.tsx +++ b/client/src/components/DatasetContainer/index.tsx @@ -72,7 +72,7 @@ const DatasetContainer = () => { }, }); - // JSX return value again trigger + // JSX return value another build testing return (