2022-12-13 19:14:48 +00:00
|
|
|
name: Build website
|
|
|
|
|
|
|
|
on:
|
2023-04-14 04:40:13 +00:00
|
|
|
- push
|
|
|
|
- pull_request
|
2022-12-13 19:14:48 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-12-15 01:31:11 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-12-13 19:14:48 +00:00
|
|
|
with:
|
|
|
|
submodules: true
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Setup Hugo
|
|
|
|
uses: peaceiris/actions-hugo@v2
|
|
|
|
with:
|
|
|
|
hugo-version: 'latest'
|
|
|
|
extended: true
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: 'cd website && hugo --minify'
|
|
|
|
|
2023-04-14 04:40:13 +00:00
|
|
|
- name: Set branch name
|
|
|
|
id: branch
|
|
|
|
run: echo "::set-output name=BRANCH_NAME::${GITHUB_REF##*/}"
|
|
|
|
|
|
|
|
- name: Deploy
|
|
|
|
if: steps.branch.outputs.BRANCH_NAME == 'master' && github.repository_owner == 'Rosettea'
|
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
publish_dir: ./website/public
|
|
|
|
keep_files: true
|
2022-12-13 19:14:48 +00:00
|
|
|
- name: Deploy
|
2023-04-14 04:40:13 +00:00
|
|
|
if: steps.branch.outputs.BRANCH_NAME != 'master' && github.repository_owner == 'Rosettea'
|
2022-12-13 19:14:48 +00:00
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
publish_dir: ./website/public
|
2023-04-14 04:40:13 +00:00
|
|
|
destination_dir: versions/${( steps.branch.outputs.BRANCH_NAME }}
|
|
|
|
keep_files: true
|