-
Notifications
You must be signed in to change notification settings - Fork 11
95 lines (91 loc) · 2.82 KB
/
main.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
#
# SPDX-License-Identifier: Apache-2.0
#
---
name: PR Build
on:
pull_request:
branches-ignore:
- gh-pages
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
build_collection:
name: Build collection
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Python 3.9
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install Python dependencies
run: pip install -Ur requirements.txt
- name: Build collection artifact
run: |
VERSION=$(yq -r .version galaxy.yml)
ansible-galaxy collection build
mv hyperledger-fabric_ansible_collection-${VERSION}.tar.gz hyperledger-fabric_ansible_collection.tar.gz
- name: Install collection
run: |
VERSION=$(yq -r .version galaxy.yml)
ansible-galaxy collection install hyperledger-fabric_ansible_collection.tar.gz
- name: Lint collection
run: |
flake8 .
ansible-lint
shellcheck tutorial/*.sh
yamllint .
- name: Publish collection
uses: actions/upload-artifact@v3
with:
name: Collection
path: hyperledger-fabric_ansible_collection.tar.gz
build_documentation:
name: Build documentation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Python 3.9
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install Python dependencies
run: pip install -Ur requirements.txt
- name: Build documentation
run: |
cd docs
make
cd ..
tar cf documentation.tar.gz docs/build
- name: Publish documentation
uses: actions/upload-artifact@v3
with:
name: Documentation
path: documentation.tar.gz
build_docker_image:
name: Build Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Python 3.9
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install Python dependencies
run: pip install -Ur requirements.txt
- name: Build Docker image
run: |
VERSION=$(yq -r .version galaxy.yml)
docker build -t hyperledger-labs/fabric-ansible-collection:${VERSION} .
docker tag hyperledger-labs/fabric-ansible-collection:${VERSION} hyperledger-labs/fabric-ansible-collection:latest
docker save hyperledger-labs/fabric-ansible-collection:${VERSION} hyperledger-labs/fabric-ansible-collection:latest | gzip -c > image.tar.gz
- name: Publish Docker image
uses: actions/upload-artifact@v3
with:
name: Docker image
path: image.tar.gz