-
Notifications
You must be signed in to change notification settings - Fork 180
167 lines (140 loc) · 4.76 KB
/
CI-publishing.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: CI-production
on:
push:
branches:
- 'master'
- '!develop'
jobs:
# auto add release tag
create_tag:
runs-on: ubuntu-latest
steps:
- name: Get slips version
run: |
VER=$(curl -s https://raw.githubusercontent.com/stratosphereips/StratosphereLinuxIPS/develop/VERSION)
echo "SLIPS_VERSION=$VER" >> $GITHUB_ENV
- uses: actions/checkout@v3
- uses: rickstaa/action-create-tag@v1
with:
tag: ${{ env.SLIPS_VERSION }}
message: ""
publish_image:
# runs the tests in a docker(built by this job) on top of a GH VM
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- type: ubuntu-image
name: ubuntu-image
image_name: slips
path: ./docker/ubuntu-image/Dockerfile
- type: macosm1-image
name: macosm1-image
image_name: slips_macos_m1
path: ./docker/macosm1-image/Dockerfile
steps:
- name: Get slips version
run: |
VER=$(curl -s https://raw.githubusercontent.com/stratosphereips/StratosphereLinuxIPS/develop/VERSION)
echo "SLIPS_VERSION=$VER" >> $GITHUB_ENV
# clone slips and checkout branch
# By default it checks out only one commit
- uses: actions/checkout@v3
with:
ref: 'master'
# Fetch all history for all tags and branches
fetch-depth: ''
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: stratosphereips
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
# build slips from target dockerfile
- name: Build our ${{ matrix.name }} from dockerfile
id: docker_build_slips
uses: docker/build-push-action@v2
with:
context: ./
file: ${{ matrix.path }}
tags: stratosphereips/${{ matrix.image_name }}:latest, stratosphereips/${{ matrix.image_name }}:${{ env.SLIPS_VERSION }}
push: true
publish_P2P_docker_image:
# runs the tests in a docker(built by this job) on stop of a GH VM
runs-on: ubuntu-20.04
# 2 hours timeout
timeout-minutes: 7200
steps:
- name: Get slips version
run: |
VER=$(curl -s https://raw.githubusercontent.com/stratosphereips/StratosphereLinuxIPS/develop/VERSION)
echo "SLIPS_VERSION=$VER" >> $GITHUB_ENV
# clone slips and checkout branch
# By default it checks out only one commit
- uses: actions/checkout@v3
with:
ref: 'master'
# Fetch all history for all tags and branches
fetch-depth: ''
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: stratosphereips
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
# Set up Docker Buildx with docker-container driver is required
# at the moment to be able to use a subdirectory with Git context
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# build p2p image for ubuntu from dockerfile
- name: Build our p2p image from dockerfile
id: docker_build_p2p_for_slips
uses: docker/build-push-action@v3
with:
allow: network.host
context: ./
file: ./docker/P2P-image/Dockerfile
tags: |
stratosphereips/slips_p2p:latest
stratosphereips/slips_p2p:${{ env.SLIPS_VERSION }}
push: true
update_code_docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: 'code-docs-branch'
fetch-depth: 0 # otherwise, you will fail to push refs to the dest repo
- name: install doxygen and python
run: |
sudo apt update
sudo apt install python3 doxygen
# deletes old docs, generates new ones, and adds all new files to git
- name: update docs
run: python3 docs/generate_docs.py
# commit and push to code docs branch
- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.GH_TOKEN_FOR_COMMITTING_AND_PUSHING_CODE_DOCS }}
message: '[Github actions] Update code docs'
branch: 'code-docs-branch'
build_and_push_dependency_image:
runs-on: ubuntu-latest
steps:
# clone slips and checkout branch
- uses: actions/checkout@v3
with:
ref: 'master'
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: stratosphereips
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push latest dependency image
id: docker_build_dependency_image
uses: docker/build-push-action@v2
with:
context: ./
file: ./docker/dependency-image/Dockerfile
tags: stratosphereips/slips_dependencies:latest
push: true