diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..368c61e --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,33 @@ +name: Deploy to AWS S3 and Invalidate CloudFront + +on: + push: + branches: + - main # Adjust this to your repository's default branch + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Sync to S3 + uses: jakejarvis/s3-sync-action@master + with: + args: --acl public-read --follow-symlinks --delete + env: + AWS_S3_BUCKET: www.xbazzi.com + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: 'us-east-1' # e.g., us-east-1 + SOURCE_DIR: './' # The root of your repository; adjust if your files are in a subdirectory + + - name: Invalidate CloudFront Distribution + uses: chetan/invalidate-cloudfront-action@v1 + env: + DISTRIBUTION: E3VV7PXHG95EM0 + PATHS: '/*' + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: 'us-east-1'