65 lines
1.8 KiB
YAML
65 lines
1.8 KiB
YAML
name: Build and Release Site
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "**"
|
|
|
|
jobs:
|
|
builder:
|
|
uses: karaolidis/workflows/.gitea/workflows/builder.yaml@main
|
|
with:
|
|
registry: git.karaolidis.com
|
|
username: ${{ github.repository_owner }}
|
|
secrets:
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
release:
|
|
runs-on: nix
|
|
needs: builder
|
|
container:
|
|
image: ${{ needs.builder.outputs.tag }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
persist-credentials: true
|
|
|
|
# FIXME: https://github.com/actions/checkout/issues/1830
|
|
- name: Checkout LFS (including submodules)
|
|
run: |
|
|
git lfs install --local
|
|
AUTH=$(git config --local http.${GITHUB_SERVER_URL}/.extraheader)
|
|
git config --local --unset http.${GITHUB_SERVER_URL}/.extraheader
|
|
git config --local http.${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git/info/lfs/objects/batch.extraheader "$AUTH"
|
|
git lfs pull
|
|
|
|
- name: Build Site
|
|
run: |
|
|
cd themes/caldwell
|
|
npm install
|
|
cd ../..
|
|
ln -s ./themes/caldwell/node_modules node_modules
|
|
hugo --config hugo.toml --minify
|
|
|
|
- name: Package Site
|
|
run: |
|
|
cd public
|
|
tar -czvf ../site.tar.gz *
|
|
|
|
- name: Release
|
|
uses: https://github.com/akkuman/gitea-release-action@main
|
|
with:
|
|
name: "Release ${{ github.sha }}"
|
|
tag_name: "release-${{ github.sha }}"
|
|
files: site.tar.gz
|
|
|
|
- name: Publish
|
|
env:
|
|
TARGET_URL: https://blog.karaolidis.com/upload
|
|
run: |
|
|
curl -X POST "$TARGET_URL" \
|
|
-H "Authorization: ${{ secrets.BLOG_API_KEY }}" \
|
|
-H "Content-Type: application/octet-stream" \
|
|
--data-binary @site.tar.gz
|