Skip to content

feat: release docker image (#209) #2

feat: release docker image (#209)

feat: release docker image (#209) #2

name: Update S3 and Cloudfront
on:
push:
branches:
- main
paths:
- .github/workflows/update-s3-and-cloudfront.yaml
- libs/tools/project.json
- libs/tools/src/s3/install
jobs:
update-s3-and-cloudfront:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
S3_BUCKET_REGION: ${{ secrets.S3_BUCKET_REGION }}
steps:
- uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.S3_BUCKET_REGION }}
- name: Deploy
# The path to the install script will be /adc/install
run: aws s3 sync ./libs/tools/src/s3 s3://${{ secrets.S3_BUCKET }}/adc
- name: Invalidate CloudFront
uses: chetan/invalidate-cloudfront-action@v2
env:
DISTRIBUTION: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
PATHS: '/'
AWS_REGION: '${{ secrets.S3_BUCKET_REGION }}'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}