2020-10-27 20:42:13 +08:00
|
|
|
name: Publish Site
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-10-30 23:47:11 +08:00
|
|
|
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
|
2020-11-05 20:27:08 +08:00
|
|
|
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`
|
2022-03-14 20:26:24 +08:00
|
|
|
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:
|
2022-03-14 20:26:24 +08:00
|
|
|
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
|
2022-03-09 18:37:30 +08:00
|
|
|
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
|
2022-03-14 20:26:24 +08:00
|
|
|
env:
|
|
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|