ericxliu-me/.gitea/workflows/publish.yaml

41 lines
1.1 KiB
YAML
Raw Normal View History

2024-06-11 18:48:20 +00:00
name: CI Hugo Publish
2024-06-11 18:46:54 +00:00
on:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
2024-06-12 04:51:43 +00:00
env:
GITHUB_SERVER_URL: "https://git.ericxliu.me"
2024-06-11 18:46:54 +00:00
steps:
2024-06-12 04:49:06 +00:00
- run: echo "github.api_url ${{ github.api_url }}"
- run: echo "github.server_url ${{ github.server_url}}"
- run: echo "GITHUB_API_URL $GITHUB_API_URL"
- run: echo "GITHUB_SERVER_URL $GITHUB_SERVER_URL"
2024-06-12 04:50:28 +00:00
- run: echo "gitea.api_url ${{ gitea.api_url }}"
- run: echo "gitea.server_url ${{ gitea.server_url}}"
- run: echo "GITEA_API_URL $GITEA_API_URL"
- run: echo "GITEA_SERVER_URL $GITEA_SERVER_URL"
2024-06-12 04:49:06 +00:00
2024-06-11 18:46:54 +00:00
- name: Checkout code
2024-06-12 03:33:17 +00:00
uses: actions/checkout@v4
2024-06-12 03:44:12 +00:00
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
2024-06-11 18:46:54 +00:00
- name: Build site with Hugo
2024-06-12 03:44:12 +00:00
uses: peaceiris/actions-hugo@v3
2024-06-11 18:46:54 +00:00
with:
2024-06-12 03:44:12 +00:00
hugo-version: '0.119.0'
2024-06-12 03:46:09 +00:00
extended: true
2024-06-11 18:46:54 +00:00
2024-06-12 03:44:12 +00:00
- name: Build
run: hugo --minify
2024-06-11 18:46:54 +00:00
2024-06-12 03:44:12 +00:00
- name: Deploy
2024-06-12 03:55:45 +00:00
uses: peaceiris/actions-gh-pages@v4
2024-06-11 18:46:54 +00:00
with:
2024-06-12 04:00:49 +00:00
publish_dir: ./public