-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a test workflow for testing publishing p2p and ubuntu image using CI
- Loading branch information
Showing
1 changed file
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: test-publishing-using-ci-will-be-removed-later | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'alya/improve-ci' | ||
- '!develop' | ||
|
||
jobs: | ||
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: 'alya/improve-ci' | ||
# 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 }}:test | ||
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: 'alya/improve-ci' | ||
# 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:test | ||
push: true |