54 lines
1.4 KiB
YAML
54 lines
1.4 KiB
YAML
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
# Allows external webhook trigger
|
|
repository_dispatch:
|
|
types:
|
|
- webhook
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: true # Fetch Hugo themes (true OR recursive)
|
|
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
|
|
|
- name: Setup Hugo
|
|
uses: https://github.com/peaceiris/actions-hugo@v2
|
|
with:
|
|
hugo-version: '0.111.3'
|
|
# extended: true
|
|
|
|
- name: Build site
|
|
run: hugo --minify
|
|
|
|
# - name: Create tarfile
|
|
# run: tar -cf website.tar public
|
|
|
|
# - name: Create release
|
|
# id: create-release
|
|
# uses: actions/release-action@main
|
|
# with:
|
|
# files: |-
|
|
# website.tar
|
|
# api_key: '${{secrets.RELEASE_TOKEN}}'
|
|
|
|
# - name: Upload artifacts
|
|
# uses: actions/upload-artifact@v3
|
|
# with:
|
|
# name: website-files.tar
|
|
# path: website.tar
|
|
|
|
- name: Setup Minio client
|
|
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 }}
|
|
|
|
- name: Deploy to Garage
|
|
run: ./mc mirror --remove --overwrite ./public/ deploy/${{ secrets.S3_BUCKET }}
|
|
|