Add more recipes. #175
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: Hugo | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
tags: | |
- .* | |
permissions: | |
id-token: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
version: 0.121.1 | |
- name: Build search index | |
run: ./download-and-run-hugo-to-json.sh | |
- name: Build | |
run: hugo --minify | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE }} | |
aws-region: us-east-1 | |
if: github.event_name == 'push' | |
- name: Sync files to S3 | |
run: aws s3 sync --delete public s3://${{ secrets.AWS_BUCKET_NAME }} | |
if: github.event_name == 'push' | |
- name: Invalidate cloudfront | |
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION }} --paths "/*" | |
if: github.event_name == 'push' |