name: Build site and deploy

on: push

jobs:
  build:
    name: Build site and deploy
    runs-on: ubuntu-20.04
    strategy:
      matrix:
        version:
          - "0.92.0"
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true
      - name: Install Hugo
        run: |
          wget https://github.com/gohugoio/hugo/releases/download/v${{ matrix.version }}/hugo_extended_${{ matrix.version }}_Linux-64bit.tar.gz
          tar xaf *.tar.gz hugo
      - name: Build site
        run: |
          set -ex
          ./hugo -v
          ./hugo -v deploy --maxDeletes -1
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
