@@ -3,64 +3,85 @@ name: CI-production-publishing-slips-images
33on :
44 push :
55 branches :
6- - ' master'
7- - ' !develop'
6+ - ' master'
7+ - ' !develop'
88
99jobs :
10- publish_slips_docker_image :
11- # runs the tests in a docker(built by this job) on stop of a GH VM
12- runs-on : ubuntu-20.04
10+ setup :
11+ runs-on : ubuntu-22.04
1312 # 2 hours timeout
14- timeout-minutes : 7200
13+ timeout-minutes : 120
14+ outputs :
15+ slips_version : ${{ steps.get_version.outputs.slips_version }}
16+ builder_name : ${{ steps.create_builder.outputs.name }}
1517
1618 steps :
17- - name : Get slips version
18- run : |
19- VER=$(curl -s https://raw.githubusercontent.com/stratosphereips/StratosphereLinuxIPS/develop/VERSION)
20- echo "SLIPS_VERSION=$VER" >> $GITHUB_ENV
19+ - name : Get slips version
20+ id : get_version
21+ run : |
22+ ver=$(curl -s https://raw.githubusercontent.com/stratosphereips/StratosphereLinuxIPS/develop/VERSION)
23+ echo "slips_version=$ver" >> $GITHUB_OUTPUT
2124
22- # clone slips and checkout branch
23- # By default it checks out only one commit
24- - uses : actions/checkout@v4
25- with :
26- ref : ' master'
27- # Fetch all history for all tags and branches
28- fetch-depth : ' '
29- # submodules are needed for local and global p2p
30- submodules : true
25+ # should come before buildx action
26+ - name : Set up QEMU
27+ uses : docker/setup-qemu-action@v3
3128
29+ # Set up Docker Buildx with docker-container driver is required
30+ # at the moment to be able to use a subdirectory with Git context
31+ - name : Create and use Buildx builder
32+ id : create_builder
33+ uses : docker/setup-buildx-action@v3
34+ with :
35+ driver : docker-container # allows multi-platform builds
36+ # allows you to enable special permissions for the build environment that are normally considered insecure,
37+ # such as:network.host
38+ buildkitd-flags : --allow-insecure-entitlement network.host
39+ name : slips_multi_arch_builder
40+ use : true
3241
33- - name : Login to DockerHub
34- uses : docker/login-action@v3
35- with :
36- username : stratosphereips
37- password : ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
42+ publish_images :
43+ needs : setup
44+ runs-on : ubuntu-22.04
45+ strategy :
46+ matrix :
47+ image_type :
48+ - name : slips
49+ dockerfile : ./docker/Dockerfile
50+ - name : slips_light
51+ dockerfile : ./docker/light/Dockerfile
3852
39- # Set up Docker Buildx with docker-container driver is required
40- # at the moment to be able to use a subdirectory with Git context
41- - name : Set up Docker Buildx
42- uses : docker/setup-buildx-action@v3
53+ steps :
54+ - name : Use existing Buildx builder
55+ uses : docker/setup-buildx-action@v3
56+ with :
57+ name : slips_multi_arch_builder
58+ install : true
59+ use : true
60+
61+ # clone slips and checkout branch
62+ # By default it checks out only one commit
63+ - uses : actions/checkout@v4
64+ with :
65+ ref : ' master'
66+ # Fetch all history for all tags and branches
67+ fetch-depth : 0
68+ # submodules are needed for local and global p2p
69+ submodules : true
4370
44- - name : Build and push the main Slips image
45- id : docker_build_slips
46- uses : docker/build-push-action@v6
47- with :
48- allow : network.host
49- context : ./
50- file : ./docker/Dockerfile
51- tags : |
52- stratosphereips/slips:latest
53- stratosphereips/slips:${{ env.SLIPS_VERSION }}
54- push : true
71+ - name : Login to DockerHub
72+ uses : docker/login-action@v3
73+ with :
74+ username : stratosphereips
75+ password : ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
5576
56- - name : Build and push the light Slips image
57- id : docker_build_light_slips
58- uses : docker/build-push-action@v6
59- with :
60- allow : network.host
61- context : ./
62- file : ./docker/light/Dockerfile
63- tags : |
64- stratosphereips/slips_light :latest
65- stratosphereips/slips_light :${{ env.SLIPS_VERSION }}
66- push : true
77+ - name : Build and push ${{ matrix.image_type.name }} image
78+ uses : docker/build-push-action@v6
79+ with :
80+ allow : network.host
81+ context : ./
82+ file : ${{ matrix.image_type.dockerfile }}
83+ platforms : linux/amd64,linux/arm64
84+ tags : |
85+ stratosphereips/${{ matrix.image_type.name }} :latest
86+ stratosphereips/${{ matrix.image_type.name }} :${{ needs.setup.outputs.slips_version }}
87+ push : true
0 commit comments