Skip to content

Commit

Permalink
chore: redeploy
Browse files Browse the repository at this point in the history
  • Loading branch information
rodentskie committed Sep 30, 2024
1 parent 39f2fab commit 862237e
Showing 1 changed file with 76 additions and 76 deletions.
152 changes: 76 additions & 76 deletions .github/workflows/p2-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,79 +230,79 @@ jobs:
printf '' > src/environments/environment.ts
node_modules/.bin/ng build --configuration=${{ env.BUILD_CONFIG }}
- run: ls -la
# ##########################################################
# # AWS S3 SYNC OPERATIONS
# ##########################################################
# - name: AWS S3 Sync Operations
# run: |
# CUTIEAPPS3=$(aws cloudformation list-exports --query "Exports[?Name==\`$STACK_NAME-CUTIES3BUCKET-$ENV\`].Value" --no-paginate --output text)
# aws s3 sync www/ s3://$CUTIEAPPS3 --delete



# ##########################################################
# # AWS CDN CACHE INVALIDATION
# ##########################################################
# - name: AWS Cloudfront Cache invalidation
# run: |
# CUTIEAPPCDN=$(aws cloudformation list-exports --query "Exports[?Name==\`$STACK_NAME-CutieCloudFrontDistributionID-$ENV\`].Value" --no-paginate --output text)
# for i in $CUTIEAPPCDN;do aws cloudfront create-invalidation --distribution-id $i --paths "/*";done



# ##########################################################
# # SLACK NOTIFICATION
# ##########################################################
# - name: Slack Notification
# if: always() # Pick up events even if the job fails or is canceled.
# uses: 8398a7/action-slack@v3
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
# MATRIX_CONTEXT: ${{ toJson(matrix) }} # required
# with:
# status: ${{ job.status }}
# author_name: ${{ env.BRANCH_TAG_NAME }} - ${{ env.ROOTSTACK }} deployed to ${{ env.ENV }} environemnt in ${{ env.STACK_NAME }} AWS account
# mention: 'here'
# if_mention: failure,cancelled
# job_name: deploy-p2-stage # Match the name above.
# fields: repo,commit,eventName,ref,workflow,message,author,job,took
# custom_payload: |
# {
# username: 'GitHub Action CI WorkFlow',
# icon_emoji: ':github:',
# attachments: [{
# color: '${{ job.status }}' === 'success' ? 'good' : ${{ job.status }}' === 'failure' ? 'danger' : 'warning',
# text:
# `${process.env.AS_REPO}\n
# ${process.env.AS_COMMIT}\n
# ${process.env.AS_EVENT_NAME}\n
# @${process.env.AS_REF}\n
# @${process.env.AS_WORKFLOW}\n
# ${process.env.AS_MESSAGE}\n
# ${process.env.AS_AUTHOR}\n
# ${process.env.AS_JOB}\n
# ${process.env.AS_TOOK}`,
# }]
# }


# # ################################################
# # # STATUS VARIABLE UPDATE
# # ################################################
# - name: Deployment status variable update
# if: ${{ failure() }}
# run: |
# echo "STATUS=FAILURE" >> $GITHUB_ENV

# # ################################################
# # # DEVOPS-DEPLOYMENT REPORT
# # ################################################
# - name: DevOps Deployment Reporting
# if: always()
# run: |
# pip install --upgrade pip
# pip install --upgrade csvtotable
# aws s3 cp s3://$STATUSREPORTS3Bucket/deploy-reporting.sh deploy-reporting.sh
# chmod +x deploy-reporting.sh && ./deploy-reporting.sh
# echo "LINK="${GITHUB_REPOSITORY##*/}.html >> $GITHUB_ENV
##########################################################
# AWS S3 SYNC OPERATIONS
##########################################################
- name: AWS S3 Sync Operations
run: |
CUTIEAPPS3=$(aws cloudformation list-exports --query "Exports[?Name==\`$STACK_NAME-CUTIES3BUCKET-$ENV\`].Value" --no-paginate --output text)
aws s3 sync www/ s3://$CUTIEAPPS3 --delete
##########################################################
# AWS CDN CACHE INVALIDATION
##########################################################
- name: AWS Cloudfront Cache invalidation
run: |
CUTIEAPPCDN=$(aws cloudformation list-exports --query "Exports[?Name==\`$STACK_NAME-CutieCloudFrontDistributionID-$ENV\`].Value" --no-paginate --output text)
for i in $CUTIEAPPCDN;do aws cloudfront create-invalidation --distribution-id $i --paths "/*";done
##########################################################
# SLACK NOTIFICATION
##########################################################
- name: Slack Notification
if: always() # Pick up events even if the job fails or is canceled.
uses: 8398a7/action-slack@v3
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MATRIX_CONTEXT: ${{ toJson(matrix) }} # required
with:
status: ${{ job.status }}
author_name: ${{ env.BRANCH_TAG_NAME }} - ${{ env.ROOTSTACK }} deployed to ${{ env.ENV }} environemnt in ${{ env.STACK_NAME }} AWS account
mention: 'here'
if_mention: failure,cancelled
job_name: deploy-p2-stage # Match the name above.
fields: repo,commit,eventName,ref,workflow,message,author,job,took
custom_payload: |
{
username: 'GitHub Action CI WorkFlow',
icon_emoji: ':github:',
attachments: [{
color: '${{ job.status }}' === 'success' ? 'good' : ${{ job.status }}' === 'failure' ? 'danger' : 'warning',
text:
`${process.env.AS_REPO}\n
${process.env.AS_COMMIT}\n
${process.env.AS_EVENT_NAME}\n
@${process.env.AS_REF}\n
@${process.env.AS_WORKFLOW}\n
${process.env.AS_MESSAGE}\n
${process.env.AS_AUTHOR}\n
${process.env.AS_JOB}\n
${process.env.AS_TOOK}`,
}]
}
# ################################################
# # STATUS VARIABLE UPDATE
# ################################################
- name: Deployment status variable update
if: ${{ failure() }}
run: |
echo "STATUS=FAILURE" >> $GITHUB_ENV
# ################################################
# # DEVOPS-DEPLOYMENT REPORT
# ################################################
- name: DevOps Deployment Reporting
if: always()
run: |
pip install --upgrade pip
pip install --upgrade csvtotable
aws s3 cp s3://$STATUSREPORTS3Bucket/deploy-reporting.sh deploy-reporting.sh
chmod +x deploy-reporting.sh && ./deploy-reporting.sh
echo "LINK="${GITHUB_REPOSITORY##*/}.html >> $GITHUB_ENV

0 comments on commit 862237e

Please sign in to comment.