MtF-wiki/.github/workflows/build-gh-pages.yml

52 lines
1.3 KiB
YAML
Raw Permalink Normal View History

2020-10-27 20:42:13 +08:00
name: Publish Site
on:
push:
branches:
- master
2020-10-27 20:42:13 +08:00
paths-ignore:
2022-08-08 21:08:12 +08:00
- .github
- README.md
- LICENSE
2020-10-27 20:42:13 +08:00
jobs:
2022-08-10 22:33:07 +08:00
build-mtf-dot-wiki:
runs-on: ubuntu-22.04
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
2020-10-27 20:42:13 +08:00
steps:
- uses: actions/checkout@v3
2020-10-27 20:42:13 +08:00
with:
submodules: true
2021-11-28 08:45:19 +08:00
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
2022-08-08 21:08:12 +08:00
hugo-version: latest
2021-11-28 08:45:19 +08:00
extended: true
2023-01-20 13:59:27 +08:00
- name: Generated Cache
uses: actions/cache@v3
with:
path: resources/_gen
key: ${{ runner.os }}-generated-${{ hashFiles('**') }}
restore-keys: ${{ runner.os }}-generated
2022-08-10 22:33:07 +08:00
- name: Build
2022-03-09 20:41:51 +08:00
run: hugo --minify --enableGitInfo
2022-08-10 22:33:07 +08:00
- name: Upload artifact
2021-11-28 08:45:19 +08:00
if: github.ref == 'refs/heads/master'
2022-08-04 22:37:56 +08:00
uses: actions/upload-pages-artifact@v1
2020-10-27 20:42:13 +08:00
with:
2022-08-04 22:37:56 +08:00
path: public
2022-08-10 22:33:07 +08:00
deploy-mtf-dot-wiki:
needs: build-mtf-dot-wiki
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-22.04
2022-08-10 22:33:07 +08:00
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1