-
Notifications
You must be signed in to change notification settings - Fork 2
/
.estafette.yaml
70 lines (60 loc) · 1.63 KB
/
.estafette.yaml
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
59
60
61
62
63
64
65
66
67
68
69
70
builder:
track: dev
labels:
app-group: estafette-ci
type: web
team: estafette-team
language: hugo
version:
semver:
major: 1
minor: 0
stages:
git-clone:
image: extensions/git-clone:dev
shallow: false
hugoify:
image: estafette/hugo:0.62.2
commands:
- echo "Generating site"
- hugo version
- hugo --minify
when:
status == 'succeeded' &&
branch != 'main'
publish:
image: estafette/hugo:0.62.2
env:
GIT_USER_EMAIL: estafette.secret(0ZJRd1ti_4HlsYz6.ie7ynUsbOMTuDEkvBdvDAmB1UL9Hu0YmxTpEve2ARAE_wTonhpe65Ek=)
GIT_USER_NAME: estafette.secret(nbg9Avv8R7CoZ1O4.GDU-1JwnPpzaBsDcjJhX4CyRhspe4amlBflh3OQoPQ==)
commands:
- git config --global user.email "${GIT_USER_EMAIL}"
- git config --global user.name "${GIT_USER_NAME}"
- echo "Checking out gh-pages branch into public dir"
- git worktree prune
- rm -rf public
- git worktree add -B gh-pages public origin/gh-pages
- echo "Removing existing files from public dir"
- rm -rf public/*
- echo "Generating site"
- hugo version
- hugo --minify
- cp CNAME public/
- cp .nojekyll public/
- echo "Updating gh-pages branch"
- LOG_MESSAGE=$(git log --format=%B -n 1)
- cd public
- git add --all
- git commit --allow-empty -m "${ESTAFETTE_BUILD_VERSION} - ${LOG_MESSAGE}"
- git push origin gh-pages --force
when:
status == 'succeeded' &&
branch == 'main'
slack-notify:
image: extensions/slack-build-status:dev
workspace: estafette
channels:
- '#build-status'
when:
status == 'succeeded' ||
status == 'failed'