on: push
name: Build and deploy
jobs:
  web-deploy:
    runs-on: docker
    container:
      image: catthehacker/ubuntu:act-latest
      options: --privileged
    steps:
      - name: Get latest code
        uses: actions/checkout@v2
      - name: Build hugo site
        uses: jakejarvis/hugo-build-action@master
        with:
          args: --minify
      - name: Clean permissions
        uses: main-quest/actions.clean-permissions@v1.0.4
      - name: Deploy to Uplink
        uses: https://github.com/shallwefootball/upload-s3-action@master
        with:
          aws_key_id: ${{ secrets.STORJ_ACCESS_KEY_ID }}
          aws_secret_access_key: ${{ secrets.STORJ_SECRET_ACCESS_KEY }}
          endpoint: ${{ secrets.STORJ_ENDPOINT }}
          aws_bucket: ${{ secrets.STORJ_BUCKET }}
          source_dir: "dist"
          destination_dir: "hack13-blog"
