Compare commits
6
Commits
0.2.0
...
d15e25abf3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d15e25abf3 | ||
|
|
53186e9a35 | ||
|
|
7688fd77c9 | ||
|
|
6e79337a60 | ||
|
|
68424aa28b | ||
|
|
fdc7fa700d |
@@ -19,6 +19,9 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: git.arthurerlich.de
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-push:
|
build-push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -40,12 +43,6 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
git checkout "refs/tags/${{ inputs.tag }}"
|
git checkout "refs/tags/${{ inputs.tag }}"
|
||||||
|
|
||||||
# Strip the protocol from the server URL to get the registry hostname.
|
|
||||||
# e.g. https://gitea.example.com → gitea.example.com
|
|
||||||
- name: Derive registry hostname
|
|
||||||
run: |
|
|
||||||
echo "REGISTRY=$(echo '${{ gitea.server_url }}' | sed 's|https://||;s|http://||')" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
# Generates OCI-compliant tags and labels from the provided release tag.
|
# Generates OCI-compliant tags and labels from the provided release tag.
|
||||||
# 1.2.3 → image tags: 1.2.3 / 1.2 / 1
|
# 1.2.3 → image tags: 1.2.3 / 1.2 / 1
|
||||||
- name: Extract Docker metadata
|
- name: Extract Docker metadata
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
name: Tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: "8.4"
|
||||||
|
extensions: intl, zip, opcache
|
||||||
|
coverage: none
|
||||||
|
|
||||||
|
- name: Cache Composer dependencies
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.composer/cache
|
||||||
|
key: composer-${{ hashFiles('composer.lock') }}
|
||||||
|
restore-keys: composer-
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: composer install --no-interaction --prefer-dist
|
||||||
|
|
||||||
|
- name: Run PHPUnit
|
||||||
|
run: vendor/bin/phpunit --testdox
|
||||||
|
|
||||||
|
- name: Run PHPStan
|
||||||
|
run: composer phpstan
|
||||||
|
|
||||||
|
docker-build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Build prod image (final target)
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: Dockerfile
|
||||||
|
target: final
|
||||||
|
push: false
|
||||||
|
|
||||||
|
- name: Build dev image (dev target)
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: Dockerfile.dev
|
||||||
|
target: dev
|
||||||
|
push: false
|
||||||
+1
-2
@@ -30,8 +30,7 @@ FROM deps AS build
|
|||||||
COPY . .
|
COPY . .
|
||||||
RUN composer dump-autoload --classmap-authoritative --no-dev --no-interaction && \
|
RUN composer dump-autoload --classmap-authoritative --no-dev --no-interaction && \
|
||||||
mkdir -p var/cache var/log && \
|
mkdir -p var/cache var/log && \
|
||||||
APP_ENV=prod APP_SECRET=placeholder php bin/console cache:warmup --no-debug && \
|
APP_ENV=prod APP_SECRET=placeholder php bin/console cache:warmup --no-debug
|
||||||
composer dump-env prod
|
|
||||||
|
|
||||||
# ── final (prod) stage — no composer binary ────────────────────────────────────
|
# ── final (prod) stage — no composer binary ────────────────────────────────────
|
||||||
FROM base AS final
|
FROM base AS final
|
||||||
|
|||||||
Reference in New Issue
Block a user