Workflow updates
This commit is contained in:
parent
a19ebf8364
commit
36ed080ef7
1 changed files with 24 additions and 16 deletions
40
.github/workflows/build.yml
vendored
40
.github/workflows/build.yml
vendored
|
@ -1,26 +1,34 @@
|
|||
name: Build and Deploy
|
||||
|
||||
on: push
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build and Deploy
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Install Hugo
|
||||
run: |
|
||||
HUGO_DOWNLOAD=hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz
|
||||
wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/${HUGO_DOWNLOAD}
|
||||
tar xvzf ${HUGO_DOWNLOAD} hugo
|
||||
mv hugo $HOME/hugo
|
||||
env:
|
||||
HUGO_VERSION: 0.72.0
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v2
|
||||
with:
|
||||
hugo-version: '0.72.0'
|
||||
extended: true
|
||||
|
||||
- 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: Hugo Build
|
||||
run: $HOME/hugo -v
|
||||
run: hugo --minify
|
||||
|
||||
- name: Deploy to S3
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: $HOME/hugo -v deploy --maxDeletes -1
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
run: hugo deploy --maxDeletes -1 --invalidateCDN
|
||||
|
|
Loading…
Reference in a new issue