5
5
name : Update documentation
6
6
7
7
on :
8
- push :
9
- branches : master
10
- tags : v**
8
+ release :
9
+ types : [published]
10
+ repository_dispatch :
11
+ types : [docs]
11
12
12
13
jobs :
13
14
documentation :
15
+ if : " !contains(github.event.head_commit.message, 'skip ci')"
14
16
runs-on : ubuntu-latest
15
- env :
16
- GITHUB_TOKEN : ${{ secrets.ADMIN_GITHUB_TOKEN }}
17
17
steps :
18
18
- name : Checkout project
19
19
uses : actions/checkout@v2
20
20
with :
21
+ token : ${{ secrets.ADMIN_GITHUB_TOKEN }}
21
22
ref : master
22
- fetch-depth : 0
23
23
- name : Fetch tags
24
24
run : git fetch --tags
25
25
- name : Setup Scala
26
26
uses : olafurpg/setup-scala@v7
27
- - name : Cache dependencies
28
- uses : actions/cache@v1
29
- with :
30
- path : ~/.cache/coursier/v1
31
- key : ${{ runner.os }}-coursier-${{ hashFiles('build.sbt') }}-${{ hashFiles('project/*.scala') }}
32
- restore-keys : ${{ runner.os }}-coursier-
33
- - name : Cache .sbt
34
- uses : actions/cache@v1
35
- with :
36
- path : ~/.sbt
37
- key : ${{ runner.os }}-sbt-${{ hashFiles('build.sbt') }}-${{ hashFiles('project/*.scala') }}
38
- restore-keys : ${{ runner.os }}-sbt-
27
+ - name : Setup Ruby
28
+ uses : actions/setup-ruby@v1
29
+ - name : Setup github-changelog-generator
30
+ run : gem install github_changelog_generator -v 1.15.0
31
+ - name : Setup yq
32
+ run : sudo snap install yq
33
+ - name : Run pre-conditions
34
+ run : test -f .github/actions.yml && eval "$(yq r .github/actions.yml -D "true" pre.docs)" || true
39
35
- name : Generate documentation
40
36
run : sbt ci-docs
41
37
env :
38
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
42
39
DOWNLOAD_INFO_FROM_GITHUB : true
43
- - name : Create Documentation Pull Request
44
- uses : peter-evans/create-pull-request@v2
40
+ - name : Run post-conditions
41
+ run : test -f .github/actions.yml && eval "$(yq r .github/actions.yml -D "true" post.docs)" || true
42
+ - name : Generate changelog
43
+ env :
44
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
45
+ repo : ${{ github.repository }}
46
+ run : |
47
+ github_changelog_generator \
48
+ --user ${repo%/*} \
49
+ --project ${repo#*/} \
50
+ --token $GITHUB_TOKEN \
51
+ --exclude-labels "duplicate,question,invalid,wontfix,auto-update,auto-changelog,auto-documentation" \
52
+ --configure-sections \
53
+ '{
54
+ "breaking": {
55
+ "prefix": "⚠️ **Breaking changes**",
56
+ "labels": ["breaking-change"]
57
+ },
58
+ "enhancement": {
59
+ "prefix": "🚀 **Features**",
60
+ "labels": ["enhancement"]
61
+ },
62
+ "documentation": {
63
+ "prefix": "📘 **Documentation**",
64
+ "labels": ["documentation"]
65
+ },
66
+ "bug": {
67
+ "prefix": "🐛 **Bug Fixes**",
68
+ "labels": ["bug"]
69
+ },
70
+ "dependency": {
71
+ "prefix": "📈 **Dependency updates**",
72
+ "labels": ["dependency-update", "scala-steward"]
73
+ }
74
+ }'
75
+ - name : Push changes
76
+ uses :
stefanzweifel/[email protected]
45
77
with :
46
- token : ${{ secrets.ADMIN_GITHUB_TOKEN }}
47
- commit-message : Update documentation and other files
48
- title : ' Update documentation and other files'
49
- labels : auto-documentation
50
- branch : auto-update-docs
51
- body : Update documentation and other files with latest changes.
78
+ commit_message : ' Update documentation, changelog and other files [skip ci]'
0 commit comments