Skip to content

Commit 56ba11c

Browse files
authored
♻️ Refactor the build CI
1 parent 32f343a commit 56ba11c

1 file changed

Lines changed: 26 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
11
name: Build EPub
22

3-
on: push
3+
on:
4+
push:
5+
branches:
6+
- main
47

58
jobs:
69
convert_via_pandoc:
710
runs-on: ubuntu-18.04
811
steps:
912
- uses: actions/checkout@v2
10-
- uses: docker://pandoc/core:2.9
13+
14+
- name: Compute tag name
15+
id: compute-tag
16+
run: |
17+
echo Computing next tag number
18+
LASTPATCH=$(git describe --tags | cut -d- -f1 | cut -d. -f3)
19+
PATCH=$(($LASTPATCH+1))
20+
echo "::set-output name=tagname::1.0.${PATCH}"
21+
22+
- name: Build release assets
23+
uses: docker://pandoc/core:2.9
1124
with:
1225
args: >- # allows you to break string into multiple lines
1326
--standalone
@@ -28,3 +41,14 @@ jobs:
2841
modulo-01/modulo-01-exercicio-06.md
2942
modulo-01/modulo-01-exercicio-07.md
3043
modulo-01/modulo-01-extra-01.md
44+
45+
- name: List files
46+
run: ls -las
47+
48+
- name: Create release
49+
uses: ncipollo/release-action@v1
50+
with:
51+
token: ${{ secrets.GITHUB_TOKEN }}
52+
tag: ${{ steps.compute-tag.outputs.tagname }}
53+
commit: main
54+
artifacts: './react.epub'

0 commit comments

Comments
 (0)