-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e83b753
commit dd386ef
Showing
1 changed file
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,11 @@ jobs: | |
else | ||
echo "BUCKET_NAME=patterns-uat.boston.gov" >> "${GITHUB_ENV}" | ||
fi | ||
if [[ {{ env.S3_DRY_RUN }} == 1 ]];then | ||
echo "S3_DEST_DIR='/'" >> "${GITHUB_ENV}" | ||
else | ||
echo "S3_DEST_DIR='/DRY_RUN/'" >> "${GITHUB_ENV}" | ||
fi | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
|
@@ -41,6 +46,7 @@ jobs: | |
cache: 'npm' | ||
|
||
- name: Build the public folder | ||
id: Build patterns and CDN assets | ||
run: | | ||
npm install | ||
npm run build | ||
|
@@ -51,15 +57,18 @@ jobs: | |
du | ||
- name: Run Percy Tests | ||
if: ${{ vars.RUN_PERCY == 1 }} | ||
run: | | ||
gem install faraday -v 1.8.0 | ||
percy snapshot public --snapshots_regex="(components\/preview.).*\.html$" --enable_javascript --trace --widths "375,1280" | ||
- name: Run Jest Tests | ||
if: ${{ vars.RUN_JEST == 1 }} | ||
run: | | ||
npm run jest.ci | ||
- name: Upload to Amazon | ||
id: Deploy to Amazon | ||
uses: jakejarvis/[email protected] | ||
with: | ||
args: --acl public-read --follow-symlinks --delete | ||
|
@@ -69,12 +78,31 @@ jobs: | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_REGION: 'us-east-2' | ||
SOURCE_DIR: 'public' | ||
DEST_DIR: ${{ env.S3_DEST_DIR }} | ||
|
||
- name: Invalidate AWS CloudFront | ||
id: Invalidate Cache | ||
uses: chetan/invalidate-cloudfront-action@v2 | ||
env: | ||
DISTRIBUTION: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} | ||
PATHS: "/*" | ||
AWS_REGION: "us-east-1" | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
DEBUG: ${{ env.DEPLOY_DEBUG }} | ||
|
||
- name: Post to Slack - success | ||
uses: act10ns/[email protected] | ||
if: ${{ success() }} | ||
with: | ||
status: ${{ job.status }} | ||
steps: ${{ toJson(steps) }} | ||
channel: ${{ vars.SLACK_MONITORING_CHANNEL }} | ||
|
||
- name: Post to Slack - failure | ||
uses: act10ns/[email protected] | ||
if: ${{ failure() }} | ||
with: | ||
status: ${{ job.status }} | ||
steps: ${{ toJson(steps) }} | ||
channel: ${{ vars.SLACK_MONITORING_CHANNEL }} |