lasthourcloud/.github/workflows/docker-image.yml

45 lines
1.2 KiB
YAML
Raw Normal View History

2023-03-20 21:17:28 +00:00
name: Docker Image CI
on:
2023-05-03 06:36:23 +00:00
# push:
# branches: [ "main" ]
# pull_request:
# branches: [ "*" ]
2023-03-20 21:17:28 +00:00
push:
2023-05-03 06:36:23 +00:00
branches: ["this-does-not-exist"]
2023-03-20 21:17:28 +00:00
pull_request:
2023-05-03 06:36:23 +00:00
branches: ["this-does-not-exist"]
2023-03-20 21:17:28 +00:00
jobs:
build:
runs-on: ubuntu-latest
steps:
2023-03-29 15:39:08 +00:00
- uses: actions/checkout@v3
2023-03-29 15:57:55 +00:00
- 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-
2023-03-29 15:39:08 +00:00
- 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
2023-04-12 20:19:03 +00:00
./vendor/bin/spin build
2023-03-29 22:23:08 +00:00
- name: Start the stack
run: |
2023-04-12 20:19:03 +00:00
./vendor/bin/spin up -d
./vendor/bin/spin exec coolify php artisan key:generate
./vendor/bin/spin exec coolify php artisan migrate:fresh --seed
2023-03-29 22:23:08 +00:00
- name: Test (missing E2E tests)
run: |
2023-04-12 20:19:03 +00:00
./vendor/bin/spin exec coolify php artisan test