-
Notifications
You must be signed in to change notification settings - Fork 192
101 lines (99 loc) · 2.87 KB
/
ci.yml
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: ci
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build image
run: docker build -t crypto101 docker/
- name: Generate documents
shell: 'script -q -e -c "bash {0}"'
run: |
set -x
set -e
docker run --rm -it -v ${{ github.workspace }}:/repo crypto101 ./build_release ./_release/
- name: Upload document
uses: actions/upload-artifact@v3
with:
name: crypto101-en.epub
path: _release/crypto101-en.epub
- name: Upload document
uses: actions/upload-artifact@v3
with:
name: crypto101-en.pdf
path: _release/crypto101-en.pdf
- name: Upload document
uses: actions/upload-artifact@v3
with:
name: crypto101-en_html.tar.gz
path: _release/crypto101-en_html.tar.gz
- name: Upload document
uses: actions/upload-artifact@v3
with:
name: crypto101-fr.epub
path: _release/crypto101-fr.epub
- name: Upload document
uses: actions/upload-artifact@v3
with:
name: crypto101-fr.pdf
path: _release/crypto101-fr.pdf
- name: Upload document
uses: actions/upload-artifact@v3
with:
name: crypto101-fr_html.tar.gz
path: _release/crypto101-fr_html.tar.gz
release:
name: Release
needs: build
runs-on: ubuntu-22.04
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Download document
uses: actions/download-artifact@v3
with:
name: crypto101-en.epub
path: /tmp
- name: Download document
uses: actions/download-artifact@v3
with:
name: crypto101-en.pdf
path: /tmp
- name: Download document
uses: actions/download-artifact@v3
with:
name: crypto101-en_html.tar.gz
path: /tmp
- name: Download document
uses: actions/download-artifact@v3
with:
name: crypto101-fr.epub
path: /tmp
- name: Download document
uses: actions/download-artifact@v3
with:
name: crypto101-fr.pdf
path: /tmp
- name: Download document
uses: actions/download-artifact@v3
with:
name: crypto101-fr_html.tar.gz
path: /tmp
- name: Release
uses: marvinpinto/action-automatic-releases@v1.2.1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
prerelease: false
files: |
/tmp/crypto101-en.epub
/tmp/crypto101-en.pdf
/tmp/crypto101-en_html.tar.gz
/tmp/crypto101-fr.epub
/tmp/crypto101-fr.pdf
/tmp/crypto101-fr_html.tar.gz