Skip to content

Commit

Permalink
Full docker setup for artifact build
Browse files Browse the repository at this point in the history
  • Loading branch information
tuutti committed Dec 12, 2024
1 parent c96895d commit e740c83
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions .github/workflows/artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e740c83

Please sign in to comment.