Skip to content

更新 上海市精神卫生中心 (#817) #1832

更新 上海市精神卫生中心 (#817)

更新 上海市精神卫生中心 (#817) #1832

name: Publish Site
on:
push:
branches:
- master
paths-ignore:
- .github
- README.md
- LICENSE
jobs:
build-mtf-dot-wiki:
runs-on: ubuntu-22.04
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: latest
extended: true
- name: Generated Cache
uses: actions/cache@v3
with:
path: resources/_gen
key: ${{ runner.os }}-generated-${{ hashFiles('**') }}
restore-keys: ${{ runner.os }}-generated
- name: Build
run: hugo --minify --enableGitInfo
- name: Upload artifact
if: github.ref == 'refs/heads/master'
uses: actions/upload-pages-artifact@v1
with:
path: public
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
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
deploy-mtfwiki-dot-com:
runs-on: ubuntu-22.04
needs: build-mtf-dot-wiki
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: latest
extended: true
- name: Generated Cache
uses: actions/cache@v3
with:
path: resources/_gen
key: ${{ runner.os }}-generated-${{ hashFiles('**') }}
restore-keys: ${{ runner.os }}-generated
- name: Build
run: hugo --minify --enableGitInfo --baseURL https://mtfwiki.com
- name: Deploy
uses: reggionick/s3-deploy@v4
if: github.ref == 'refs/heads/master'
with:
folder: public
bucket: mtfwiki.com
bucket-region: ${{ secrets.S3_BUCKET_REGION }}
delete-removed: true
private: true
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}