-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (47 loc) · 1.48 KB
/
test-and-release.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
52
53
54
55
56
57
58
name: Generate test site to ensure it works
on:
push:
branches:
- main
- feature/*
- bugfix/*
jobs:
build-exampleSite:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 1
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 0.121.2
extended: true
- name: Test if exmapleSite can be built
run: |
cd exampleSite
# install PaperMod theme
git clone --depth=1 https://github.com/adityatelange/hugo-PaperMod.git themes/PaperMod
# install hugo-kofi-shortcodes
ln -s ../ themes/hugo-kofi-shortcodes
ls -la themes/
hugo config
hugo --minify
# clean up
rm -rf themes/*
- name: Bump version and push tag
if: github.ref == 'refs/heads/main'
id: tag_version
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create normal GitHub release
if: github.ref == 'refs/heads/main' && github.event_name != 'schedule'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag_version.outputs.new_tag }}
release_name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}