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

60 lines
1.7 KiB
YAML

name: Publish Site
on:
push:
branches:
- master
paths-ignore:
- 'README.md'
- 'LICENSE'
jobs:
build-deploy:
runs-on: ubuntu-20.04
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: latest
extended: true
- name: Hugo Cache
uses: actions/cache@v2
with:
path: /tmp/hugo_cache
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-hugomod-
- name: Build `mtf.wiki`
run: hugo --minify
- name: Deploy `mtf.wiki`
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/master'
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
- name: Build `mtfwiki.com`
run: hugo --minify --baseURL https://mtfwiki.com
- name: Deploy `mtfwiki.com`
uses: reggionick/s3-deploy@v3
if: github.ref == 'refs/heads/master'
with:
folder: ./public
bucket: mtfwiki
bucket-region: ${{ secrets.S3_BUCKET_REGION }}
dist-id: E1TI1WW8VI3XF5
invalidation: /*
delete-removed: true
no-cache: true
private: true
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}