-
Notifications
You must be signed in to change notification settings - Fork 30
58 lines (50 loc) · 1.63 KB
/
build-docker-compose.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
name: Build Docker Compose Projects
on:
push:
branches: [ main, test-workflow ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
get-project-list:
runs-on: ubuntu-latest
outputs:
projects: ${{ steps.dir-list.outputs.directories }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: 'recursive' # Add this line to checkout submodules
- name: Get list of directories
id: dir-list
run: echo "directories=$(ls -d */ | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
build-project:
needs: get-project-list
runs-on: ubuntu-latest
strategy:
matrix:
project: ${{fromJson(needs.get-project-list.outputs.projects)}}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: 'recursive' # Add this line to checkout submodules
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Install Docker Compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/v2.17.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
- name: Build and test ${{ matrix.project }}
run: |
echo "Building ${{ matrix.project }}"
cd ${{ matrix.project }}
cp env-example.txt .env
echo "Contents of ${{ matrix.project }}:"
ls -la
echo "Running docker-compose build"
docker-compose build --no-cache
cd ..
env:
ACTIONS_STEP_DEBUG: true