Merge pull request #8 from toadslop/static-site-infra #1
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
name: Build and Publish to AWS | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: taiki-e/install-action@v2 | |
with: | |
tool: [email protected] | |
- name: Build | |
working-directory: ./static-site | |
run: zola build | |
- uses: reggionick/s3-deploy@v4 | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
with: | |
folder: static-site/public | |
bucket: ${{ secrets.S3_BUCKET }} | |
private: true | |
bucket-region: us-east-1 | |
# Use the next two only if you have created a CloudFront distribution | |
dist-id: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} | |
invalidation: /* |