-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (43 loc) · 1.28 KB
/
generate.yml
File metadata and controls
49 lines (43 loc) · 1.28 KB
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
name: Generate pages
# Based on
# https://blog.benhpoh.com/2022/01/21/trigger-another-github-repos-workflow/
# https://lannonbr.com/blog/2019-12-09-git-commit-in-actions/
on:
workflow_dispatch:
inputs:
hugoVersion:
description: 'Hugo version to use to generate site.'
required: false
default: '0.115.4'
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Checkout blog
uses: actions/checkout@v3
with:
repository: 'inianv/blog'
submodules: true
fetch-depth: 0
- name: Checkout inianv.github.io
uses: actions/checkout@v3
with:
path: public
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "${{ github.event.inputs.logLevel }}"
- name: Generate
run: hugo --minify
- name: Add changes and commit
run: |
COMMIT_MSG=$(git log -1 --pretty=format:"%s")
cd public
git add -vA
git config user.name "GitHub Actions"
git config user.email "github-actions@github.com"
git commit -m "${COMMIT_MSG}" && git push -u origin main || echo