2020-08-31 13:40:11 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2023-03-08 17:36:16 +00:00
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
2020-08-31 13:40:11 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-01-23 09:05:23 +00:00
|
|
|
uses: actions/checkout@v4
|
2020-08-31 13:40:11 +00:00
|
|
|
|
|
|
|
- name: Setup Hugo
|
2022-10-25 06:42:05 +00:00
|
|
|
uses: peaceiris/actions-hugo@v2.6.0
|
2020-08-31 13:40:11 +00:00
|
|
|
with:
|
|
|
|
hugo-version: latest
|
|
|
|
|
|
|
|
- name: Build local ./exampleSite
|
2023-03-15 12:32:22 +00:00
|
|
|
run: hugo --minify --gc --destination ../public --source ./exampleSite --themesDir ../.. --baseURL https://janraasch.github.io/hugo-bearblog/
|
2024-01-23 10:07:09 +00:00
|
|
|
|
2023-03-08 17:36:16 +00:00
|
|
|
- name: Upload Artifact
|
2024-01-23 09:36:08 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2020-08-31 13:40:11 +00:00
|
|
|
with:
|
2023-03-08 17:36:16 +00:00
|
|
|
name: build
|
|
|
|
path: ./public
|
2024-01-23 10:07:09 +00:00
|
|
|
|
2023-03-08 17:36:16 +00:00
|
|
|
deploy:
|
|
|
|
needs: build
|
|
|
|
name: Deploy to GitHub Pages
|
|
|
|
runs-on: ubuntu-latest
|
2023-03-08 17:45:36 +00:00
|
|
|
if: github.event_name == 'push'
|
2023-03-08 17:36:16 +00:00
|
|
|
steps:
|
2024-01-23 09:05:23 +00:00
|
|
|
- uses: actions/checkout@v4
|
2024-01-23 09:33:33 +00:00
|
|
|
- uses: actions/download-artifact@v4
|
2023-03-08 17:36:16 +00:00
|
|
|
with:
|
|
|
|
name: build
|
|
|
|
path: ./public
|
2023-03-15 12:32:22 +00:00
|
|
|
- uses: peaceiris/actions-gh-pages@v3.9.2
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
publish_dir: ./public
|