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

54 lines
1.5 KiB
YAML
Raw 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:
2021-12-24 10:23:22 +08:00
- '.github'
2020-10-27 20:42:13 +08:00
- 'README.md'
- 'LICENSE'
jobs:
build-deploy:
2021-11-28 08:45:19 +08:00
runs-on: ubuntu-20.04
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
2020-10-27 20:42:13 +08:00
steps:
2021-11-28 08:45:19 +08:00
- uses: actions/checkout@v2
2020-10-27 20:42:13 +08:00
with:
submodules: true
2021-11-28 08:45:19 +08:00
fetch-depth: 0
2022-02-05 22:40:17 +08:00
# - uses: actions/setup-node@v2
# - run: npx markdownlint-cli .
2021-11-28 08:45:19 +08:00
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
2022-03-12 23:04:25 +08:00
hugo-version: 0.94.0
2021-11-28 08:45:19 +08:00
extended: true
2021-11-28 10:22:06 +08:00
- name: Build `mtf.wiki`
2022-03-09 20:41:51 +08:00
run: hugo --minify --enableGitInfo
2021-11-28 09:24:30 +08:00
- name: Deploy `mtf.wiki`
uses: peaceiris/actions-gh-pages@v3
2021-11-28 08:45:19 +08:00
if: github.ref == 'refs/heads/master'
2020-10-27 20:42:13 +08:00
with:
deploy_key: ${{ secrets.DEPLOY_KEY }}
publish_branch: master
publish_dir: ./public
cname: mtf.wiki
external_repository: mtf-wiki/mtf-wiki.github.io
force_orphan: true
2021-11-28 10:22:06 +08:00
- name: Build `mtfwiki.com`
2022-03-09 20:41:51 +08:00
run: hugo --minify --enableGitInfo --baseURL https://mtfwiki.com
2021-11-28 09:24:30 +08:00
- name: Deploy `mtfwiki.com`
uses: reggionick/s3-deploy@v3
if: github.ref == 'refs/heads/master'
with:
folder: ./public
bucket: mtfwiki.com
2021-11-28 09:24:30 +08:00
bucket-region: ${{ secrets.S3_BUCKET_REGION }}
2021-11-28 09:31:45 +08:00
delete-removed: true
private: true
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}