File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Publish to developers.betternow.org
22on : [push]
3+ permissions :
4+ id-token : write
5+ contents : read
36
47jobs :
58 build :
9+ name : Build and Deploy
610 runs-on : ubuntu-latest
7- environment : deploy
811 steps :
912 - name : Checkout
1013 uses : actions/checkout@v2
@@ -17,16 +20,12 @@ jobs:
1720 - name : Build site
1821 run : |
1922 bin/build
20- - name : Sync to S3 & Invalidate Cloudfront Distribution
21- uses : raulanatol/aws-s3-docker-action@51bf48df23ad1577542b86c6541dcaaec4d8df31
22- env :
23- AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
24- AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
25- AWS_REGION : " eu-west-1"
26- AWS_BUCKET_NAME : " developer-betternow-site"
27- SOURCE : build
28- TARGET : " "
29- WITH_DELETE : true
30- WITH_CLOUD_FRONT_INVALIDATION : true
31- AWS_CLOUDFRONT_DISTRIBUTION_ID : ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }}
32- AWS_CLOUDFRONT_INVALIDATION_PATH : /
23+ - name : Configure AWS credentials
24+ uses : aws-actions/configure-aws-credentials@v1
25+ with :
26+ role-to-assume : arn:aws:iam::357932486739:role/developer-docs-deployer
27+ role-session-name : deploydeveloperdocs
28+ aws-region : eu-west-1
29+ - name : Deploy the site
30+ run : |
31+ bin/deploy
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -e
4+ set -o pipefail
5+
6+ SOURCE_DIR=${SOURCE_DIR:- build}
7+ BUCKET=${BUCKET:- s3:// developer-betternow-site/ }
8+ AWS_CLOUDFRONT_DISTRIBUTION_ID=${AWS_CLOUDFRONT_DISTRIBUTION_ID:- E1GR0YW1J3YFRL}
9+ INVALIDATION_PATHS=${INVALIDATION_PATHS:-/ }
10+
11+ aws s3 sync " ${SOURCE_DIR} " " ${BUCKET} " --with-delete
12+
13+ aws cloudfront create-invalidation \
14+ --distribution-id " ${AWS_CLOUDFRONT_DISTRIBUTION_ID} " \
15+ --paths " ${INVALIDATION_PATHS} "
You can’t perform that action at this time.
0 commit comments