55name : Update documentation
66
77on :
8- push :
9- branches : master
10- tags : v**
8+ release :
9+ types : [published]
10+ repository_dispatch :
11+ types : [docs]
1112
1213jobs :
1314 documentation :
15+ if : " !contains(github.event.head_commit.message, 'skip ci')"
1416 runs-on : ubuntu-latest
15- env :
16- GITHUB_TOKEN : ${{ secrets.ADMIN_GITHUB_TOKEN }}
1717 steps :
1818 - name : Checkout project
1919 uses : actions/checkout@v2
2020 with :
21+ token : ${{ secrets.ADMIN_GITHUB_TOKEN }}
2122 ref : master
22- fetch-depth : 0
2323 - name : Fetch tags
2424 run : git fetch --tags
2525 - name : Setup Scala
2626 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
3935 - name : Generate documentation
4036 run : sbt ci-docs
4137 env :
38+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4239 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/git-auto-commit-action@v4.1.3
4577 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