Workflow updates

This commit is contained in:
Salar Rahmanian 2020-07-24 23:19:45 -07:00
parent a19ebf8364
commit 36ed080ef7

View file

@ -1,26 +1,34 @@
name: Build and Deploy name: Build and Deploy
on: push on:
push:
branches:
- master
jobs: jobs:
build: build:
name: Build and Deploy name: Build and Deploy
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
- name: Install Hugo with:
run: | submodules: true
HUGO_DOWNLOAD=hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz
wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/${HUGO_DOWNLOAD} - name: Setup Hugo
tar xvzf ${HUGO_DOWNLOAD} hugo uses: peaceiris/actions-hugo@v2
mv hugo $HOME/hugo with:
env: hugo-version: '0.72.0'
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 - name: Hugo Build
run: $HOME/hugo -v run: hugo --minify
- name: Deploy to S3 - name: Deploy to S3
if: github.ref == 'refs/heads/master' run: hugo deploy --maxDeletes -1 --invalidateCDN
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 }}