softinio.com/.github/workflows/build.yml

48 lines
1 KiB
YAML
Raw Normal View History

name: Build and Deploy
2022-10-15 11:43:48 -07:00
on:
pull_request:
2020-07-24 23:19:45 -07:00
push:
branches:
- master
jobs:
build:
2022-10-15 11:43:48 -07:00
name: Build
runs-on: ubuntu-latest
steps:
2020-07-24 23:19:45 -07:00
- uses: actions/checkout@v2
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
2022-10-11 19:11:55 -07:00
hugo-version: '0.104.3'
2020-07-24 23:19:45 -07:00
extended: true
2022-10-15 11:43:48 -07:00
- name: Hugo Build
run: hugo --minify
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: [build]
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v2.3.4
with:
fetch-depth: 0
- uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.104.3'
extended: true
2020-09-06 22:46:15 -07:00
- 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: us-east-1
- name: Deploy to S3
2020-09-06 22:46:48 -07:00
run: hugo deploy --maxDeletes -1 --invalidateCDN
2022-10-15 11:43:48 -07:00