Skip to content

Commit 637c950

Browse files
committed
ci: enable workflow on tags
1 parent 694022d commit 637c950

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
push:
99
branches:
1010
- '*'
11+
tags:
12+
- "v*.*.*"
1113

1214
concurrency:
1315
group: ${{format('{0}:{1}', github.repository, github.ref)}}
@@ -126,7 +128,7 @@ jobs:
126128

127129
docs:
128130
needs: build
129-
if: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop') && github.event_name == 'push' }}
131+
if: ${{ github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/')) }}
130132
defaults:
131133
run:
132134
shell: bash
@@ -192,9 +194,16 @@ jobs:
192194
with:
193195
files: LICENSE
194196
name: ${{ github.ref_name || github.ref }}
195-
tag_name: ${{ github.ref_name || github.ref }}${{ (!startsWith(github.ref, 'refs/tags/')) && '-release' }}
197+
tag_name: ${{ github.ref_name || github.ref }}${{ ((!startsWith(github.ref, 'refs/tags/')) && '-release') || '' }}
196198
body_path: CHANGELOG.md
197199
prerelease: false
198200
draft: false
199201
token: ${{ github.token }}
200202

203+
- uses: dev-drprasad/delete-older-releases@v0.2.1
204+
if: ${{ github.event_name == 'push' && contains(fromJSON('["master", "develop"]'), github.ref_name) }}
205+
with:
206+
keep_latest: 1
207+
delete_tag_pattern: ${{ github.ref_name }}
208+
env:
209+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)