-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (81 loc) · 2.8 KB
/
docker-image.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: Docker Image CI
on:
push:
branches: [ "actions-tests2" ]
pull_request:
branches: [ "actions-tests2" ]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true
token: ${{ secrets.CI_TOKEN }}
- name: Install python dependencies
run: |
pip install -r requirements.txt
- name: Create certificates
run: |
openssl req -x509 -newkey rsa:4096 -nodes -out app/cert.pem -keyout app/key.pem -days 1 -subj "/C=PL/ST=State/L=/O=/OU=/CN=localhost"
- name: Build and Run Docker image
run: |
IMAGE_NAME="zostaw/multiarch-home-page"
IMAGE_TAG="latest"
docker build -t $IMAGE_NAME:$IMAGE_TAG .
docker compose up -d
- name: Create Docker Network
run: docker network create my-network
- name: attach to network
run: docker network connect my-network home-page-home-page-1
- name: Verify in next job
run: |
sleep 3
docker ps
- name: Wget localhost
run: |
wget --no-check-certificate --mirror --page-requisites --convert-links \
--no-parent -P downloaded-site https://localhost:8080
- name: List WORKSPACE
run: sudo mkdir -m 777 $PWD/reports
- name: Execute tests
run: |
docker run --network=my-network --shm-size=1g -e BROWSER=chrome -v ${PWD}/robot_tests:/opt/robotframework/tests:Z -v $PWD/reports:/opt/robotframework/reports:Z ppodgorsek/robot-framework:latest
# - name: Execute tests
# uses: joonvena/[email protected]
# with:
# browser: chrome
- name: Upload test results
uses: actions/upload-artifact@v1
if: always()
with:
name: reports
path: reports
build:
needs: build-and-test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true
token: ${{ secrets.CI_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: . # Path to the Dockerfile
push: true
platforms: linux/arm/v6,linux/arm/v8,linux/arm64,linux/amd64
tags: |
zostaw/multiarch-home-page:latest
zostaw/multiarch-home-page:${{ github.sha }}