gh-pages in fork #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: gh-pages in fork | |
on: | |
push: | |
branches: | |
- main # 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 Hugo themes (true OR recursive) | |
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | |
- name: Get Theme | |
run: | | |
git submodule update --init themes/showtime-theme-2021 | |
- 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: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public |