ci: output website builds from other branches to different dirs

doc-opts
sammyette 2023-04-14 00:40:13 -04:00
parent 9c6d6c4f31
commit a37f8e3b30
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 16 additions and 4 deletions

View File

@ -1,10 +1,8 @@
name: Build website name: Build website
on: on:
push: - push
branches: - pull_request
- master
- docs-refactor
jobs: jobs:
deploy: deploy:
@ -24,8 +22,22 @@ jobs:
- name: Build - name: Build
run: 'cd website && hugo --minify' run: 'cd website && hugo --minify'
- name: Set branch name
id: branch
run: echo "::set-output name=BRANCH_NAME::${GITHUB_REF##*/}"
- name: Deploy - name: Deploy
if: steps.branch.outputs.BRANCH_NAME == 'master' && github.repository_owner == 'Rosettea'
uses: peaceiris/actions-gh-pages@v3 uses: peaceiris/actions-gh-pages@v3
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website/public publish_dir: ./website/public
keep_files: true
- 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
destination_dir: versions/${( steps.branch.outputs.BRANCH_NAME }}
keep_files: true