-
Notifications
You must be signed in to change notification settings - Fork 9
74 lines (66 loc) · 2.02 KB
/
s2m_2_docker_build_on_oss.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
name: Build Docker Images on Multiple OS
on:
push:
branches:
- '**'
#workflow_run:
# workflows: ["Check Version Difference"]
# types:
# - completed
jobs:
build-docker:
# Remove the below line to run the workflow with Act
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Docker for Linux
if: matrix.os == 'ubuntu-latest'
run: |
cp .env.example .env
sed -i "s/'jsonrpc'/'localhost'/g" .env
sudo apt-get update
sudo apt-get install -y docker.io
sudo systemctl start docker
sudo systemctl enable docker
sudo usermod -aG docker $USER
shell: bash
- name: Set up Docker - Windows
if: matrix.os == 'windows-latest'
run: |
copy .env.example .env
powershell -Command "(Get-Content .env) -replace \"'jsonrpc'\", \"'localhost'\" | Set-Content .env"
choco install docker-cli
Start-Service com.docker.service
shell: powershell
- name: Set up Docker for macOS
if: matrix.os == 'macos-latest'
run: |
cp .env.example .env
sed -i '' "s/'jsonrpc'/'localhost'/g" .env
brew install --cask docker
open /Applications/Docker.app & # Start Docker in background
# Wait for Docker to start
timeout=300 # Timeout after 300 seconds (5 minutes)
until docker info >/dev/null 2>&1 || [ $timeout -eq 0 ]; do
echo "Waiting for Docker to start..."
sleep 5
((timeout-=5))
done
if [ $timeout -eq 0 ]; then
echo "Timed out waiting for Docker to start"
exit 1
else
echo "Docker is up and running!"
fi
shell: bash
- name: Build Docker images
run: |
for DOCKERFILE in docker/*; do
docker build -f $DOCKERFILE -t os-builds-$DOCKERFILE .
done