forked from htw-imi-showtime/showtime-website
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (42 loc) · 1.5 KB
/
gh-pages-branch.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Generic Workflow that builds the hugo page from . (root dir of the repo)
# sets the baseURL for hugo to 'https://<owner>.github.io/<repo>'
# publishes the hugo page using the (older) option by pushing the
# page to the branch gh-pages
# use it with <repo>->Settings->Pages "Deploy from a branch"
# Select Branch: "gh-pages" Select Folder: "/(root)"
# Contains a RUN_IF to prevent it from running in the original repo
# This is here for legacy reasons. If in doubt, use the workflow in gh-pages-action.yml !
name: Deploy Page using Branch
on:
push:
branches:
- gh_pages_deploy_fix # Set a branch that will trigger a deployment
workflow_dispatch:
jobs:
deploy:
if: ${{ github.repository_owner != 'htw-imi-showtime' }}
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: false
fetch-depth: 1
# see https://github.com/marketplace/actions/hugo-setup
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: 'latest'
extended: true
- name: Build
run: |
hugo \
--environment production \
--buildDrafts \
--baseURL 'https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}'
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/main'
with:
publish_dir: ./public