mziesel.com/.gitea/workflows/hugo.yaml

40 lines
1.1 KiB
YAML
Raw Normal View History

2023-06-12 18:29:31 +00:00
on:
push:
2023-06-13 17:16:53 +00:00
branches:
2023-06-13 17:22:12 +00:00
- main
2023-06-13 17:16:53 +00:00
pull_request:
2023-06-12 18:29:31 +00:00
jobs:
2023-06-13 17:16:53 +00:00
deploy:
2023-06-12 18:29:31 +00:00
runs-on: ubuntu-latest
steps:
2023-06-13 17:16:53 +00:00
- uses: actions/checkout@v3
2023-06-12 18:29:31 +00:00
with:
2023-06-13 17:16:53 +00:00
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
2023-06-12 20:15:41 +00:00
2023-06-13 17:16:53 +00:00
- name: Setup Hugo
uses: https://github.com/peaceiris/actions-hugo@v2
2023-06-12 18:29:31 +00:00
with:
2023-06-13 17:16:53 +00:00
hugo-version: '0.111.3'
# extended: true
2023-06-12 18:29:31 +00:00
2023-06-13 17:22:12 +00:00
- name: Build site
2023-06-13 17:16:53 +00:00
run: hugo --minify
2023-06-13 17:27:36 +00:00
- name: Create tarfile
2023-06-13 17:30:38 +00:00
run: tar -cf website.tar public
2023-06-13 17:27:36 +00:00
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
2023-06-13 17:32:06 +00:00
name: website-files.tar
2023-06-13 17:27:36 +00:00
path: website.tar
2023-06-14 15:08:43 +00:00
- name: Deploy to Garage
uses: https://github.com/mamal72/minio-perfect-deploy-action@main
with:
endpoint: ${{ secrets.MINIO_ENDPOINT }}
access_key: ${{ secrets.MINIO_ACCESS_KEY }}
secret_key: ${{ secrets.MINIO_SECRET_KEY }}
bucket: ${{ secrets.MINIO_BUCKET }}
source_dir: 'public'
target_dir: '/'