From e740c8379ce104305555c16ce5df7ac8931c6dd0 Mon Sep 17 00:00:00 2001 From: tuutti Date: Thu, 12 Dec 2024 19:02:13 +0200 Subject: [PATCH] Full docker setup for artifact build --- .github/workflows/artifact.yml | 38 ++++++++++++++++------------------ 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/.github/workflows/artifact.yml b/.github/workflows/artifact.yml index fba5c53c..c0d19039 100644 --- a/.github/workflows/artifact.yml +++ b/.github/workflows/artifact.yml @@ -8,33 +8,31 @@ name: Build artifacts jobs: build: runs-on: ubuntu-latest - container: - image: ghcr.io/city-of-helsinki/drupal-web:8.3 - options: --user 1001 - - services: - db: - image: mysql:8 - env: - MYSQL_USER: drupal - MYSQL_PASSWORD: drupal - MYSQL_DATABASE: drupal - MYSQL_ROOT_PASSWORD: drupal - ports: - - 3306:3306 - steps: - uses: actions/checkout@v4 + - name: Install and start Stonehenge + run: | + git clone -b 5.x https://github.com/druidfi/stonehenge.git ~/stonehenge + cd ~/stonehenge && make up + + # This must be done after we start Stonehenge. + - name: Setup Docker compose environment variables + run: | + echo "COMPOSE_FILE=compose.yaml:compose.ci.yaml" >> $GITHUB_ENV + + - name: Start project + run: make up + - name: Build project - run: composer install --no-interaction + run: docker compose exec app bash -c "composer install --no-interaction" - name: Setup drupal and save database dump run: | - drush si -y && drush cr - drush si --existing-config -y - drush cim -y - drush sql-dump --result-file=${GITHUB_WORKSPACE}/latest.sql + docker compose exec app bash -c "drush si -y && drush cr" + docker compose exec app bash -c "drush si --existing-config -y" + docker compose exec app bash -c "drush cim -y" + docker compose exec app bash -c "drush sql-dump --result-file=/app/latest.sql" - name: Upload latest database dump uses: actions/upload-artifact@v4