41 lines
1.1 KiB
YAML
41 lines
1.1 KiB
YAML
name: Docker Image CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "*" ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Cache Docker layers
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
/usr/local/share/ca-certificates
|
|
/var/cache/apt/archives
|
|
/var/lib/apt/lists
|
|
~/.cache
|
|
key: ${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-docker-
|
|
- name: Build the Docker image
|
|
run: |
|
|
cp .env.example .env
|
|
docker run --rm -u "$(id -u):$(id -g)" \
|
|
-v "$(pwd):/app" \
|
|
-w /app composer:2 \
|
|
composer install --ignore-platform-reqs
|
|
./vendor/bin/sail build
|
|
- name: Start the stack
|
|
run: |
|
|
./vendor/bin/sail up -d
|
|
./vendor/bin/sail artisan key:generate
|
|
./vendor/bin/sail artisan migrate:fresh --seed
|
|
- name: Test (missing E2E tests)
|
|
run: |
|
|
./vendor/bin/sail artisan test
|