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

54 lines
1.4 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-10-01 21:48:20 +00:00
workflow_dispatch:
# Allows external webhook trigger
repository_dispatch:
types:
- webhook
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-09-30 18:02:41 +00:00
2023-09-30 18:35:50 +00:00
# - name: Create tarfile
# run: tar -cf website.tar public
2023-09-30 18:13:49 +00:00
2023-09-30 18:35:50 +00:00
# - name: Create release
# id: create-release
# uses: actions/release-action@main
# with:
# files: |-
# website.tar
# api_key: '${{secrets.RELEASE_TOKEN}}'
2023-09-30 18:13:49 +00:00
# - name: Upload artifacts
# uses: actions/upload-artifact@v3
# with:
# name: website-files.tar
# path: website.tar
2023-09-30 18:02:41 +00:00
2023-07-08 18:24:22 +00:00
- name: Setup Minio client
2023-07-08 18:20:06 +00:00
run: wget https://dl.min.io/client/mc/release/linux-amd64/mc && chmod +x ./mc && ./mc alias set deploy ${{ secrets.S3_ENDPOINT }} ${{ secrets.S3_ACCESS_KEY }} ${{ secrets.S3_SECRET_KEY }}
2023-07-08 18:18:37 +00:00
2023-06-14 15:08:43 +00:00
- name: Deploy to Garage
2023-09-30 18:02:41 +00:00
run: ./mc mirror --remove --overwrite ./public/ deploy/${{ secrets.S3_BUCKET }}