mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-10-21 14:53:52 -07:00
remove frontend PR artifacts from S3 (#665)
* adds initial prefix * adds steps * adds names * adds runs-on * tests direct env * add prefix to folder * rm AWS * adds s3 uri * adds recursive * removes slash * Trigger Build * Trigger Build * remove recursive * update GHA name * adds slash to s3 uri * Trigger Build * adds ls * Trigger Build * Trigger Build * Trigger Build * list main s3 bucket * Trigger Build * list j4-tool dir * Trigger Build * Trigger Build * Add rm cmd * adds CDN as env var * modify web cdn id * update cdn id * Trigger Build * Remove artifacts on PR merge - also make the web cdn an env variable * make web CDN an env variable * Update CDN ID to newest CDN * Add test remove artifacts yml file * Add jobs to test.yml * Update PR number to 111 * Remove testing artifacts yaml file
This commit is contained in:
parent
819113ceb7
commit
b913cf21e6
2 changed files with 10 additions and 3 deletions
7
.github/workflows/deploy_main.yml
vendored
7
.github/workflows/deploy_main.yml
vendored
|
@ -8,6 +8,9 @@ on:
|
|||
branches: [main]
|
||||
paths:
|
||||
- "client/**/*"
|
||||
env:
|
||||
PR_NUMBER: ${{github.event.pull_request.number}}
|
||||
WEB_CDN_ID: E27WCOZZ03KIBX
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -79,11 +82,13 @@ jobs:
|
|||
- name: Invalidate cache on AWS CDNs
|
||||
uses: chetan/invalidate-cloudfront-action@master
|
||||
env:
|
||||
DISTRIBUTION: "ED03LPVC4OXSW" # TODO: update to new CDN after access is provided
|
||||
DISTRIBUTION: ${{env.WEB_CDN_ID}}
|
||||
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: Remove staging artifacts
|
||||
run: aws s3 rm s3://usds-geoplatform-justice40-website/justice40-tool/ --exclude "*" --include "$(echo $PR_NUMBER)-*" --recursive
|
||||
- name: Update PR with deployed URL
|
||||
uses: mshick/add-pr-comment@v1
|
||||
with:
|
||||
|
|
6
.github/workflows/deploy_staging.yml
vendored
6
.github/workflows/deploy_staging.yml
vendored
|
@ -7,6 +7,8 @@ on:
|
|||
branches: [main]
|
||||
paths:
|
||||
- "client/**/*"
|
||||
env:
|
||||
PR_NUMBER: ${{github.event.pull_request.number}}
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -24,7 +26,7 @@ jobs:
|
|||
node-version: ${{ matrix.node-version }}
|
||||
- name: Set DESTINATION_FOLDER for branch
|
||||
run: |
|
||||
echo "DESTINATION_FOLDER=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV
|
||||
echo "DESTINATION_FOLDER=$(echo $PR_NUMBER-$GITHUB_SHA | cut -c 1-11)" >> $GITHUB_ENV
|
||||
- name: Install
|
||||
run: npm ci
|
||||
- name: Build
|
||||
|
@ -66,7 +68,7 @@ jobs:
|
|||
path: ./public
|
||||
- name: Set DESTINATION_FOLDER for branch
|
||||
run: |
|
||||
echo "DESTINATION_FOLDER=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV
|
||||
echo "DESTINATION_FOLDER=$(echo $PR_NUMBER-$GITHUB_SHA | cut -c 1-11)" >> $GITHUB_ENV
|
||||
- name: Deploy to Github Pages
|
||||
uses: JamesIves/github-pages-deploy-action@4.1.0
|
||||
with:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue