Skip to content

xrx state machine initial draft #15

xrx state machine initial draft

xrx state machine initial draft #15

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