Gitea runner action
Build and Deploy / build (push) Failing after 43s

This commit is contained in:
root
2026-08-16 16:26:36 -01:00
parent 2960aa7497
commit 36c120d1bf
3 changed files with 121 additions and 33 deletions
+9 -2
View File
@@ -1,2 +1,9 @@
public/img .git
storage vendor
node_modules
storage/logs
storage/framework/cache/*
storage/framework/sessions/*
storage/framework/views/*
storage/app/public
.env
+55
View File
@@ -0,0 +1,55 @@
name: Build and Deploy
run-name: ${{ gitea.actor }} is building ${{ gitea.repository }}
on:
push:
branches:
- main
paths:
- 'Dockerfile'
- 'composer.json'
- 'composer.lock'
- '.gitea/workflows/build-docker.yml'
jobs:
build:
runs-on: ubuntu-latest
env:
REGISTRY: git.nhgooi.nl
IMAGE: git.nhgooi.nl/nh_gooi/nhgooi.nl
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Gitea Container Registry
run: |
echo "${{ secrets.REGISTRY_TOKEN }}" | \
docker login "$REGISTRY" \
-u "${{ gitea.actor }}" \
--password-stdin
- name: Build image
run: |
docker build \
-t "$IMAGE:${{ gitea.sha }}" \
-t "$IMAGE:latest" \
.
- name: Push image
run: |
docker push "$IMAGE:${{ gitea.sha }}"
docker push "$IMAGE:latest"
- name: Trigger deployment
run: |
curl --fail-with-body \
-X POST \
-H "Content-Type: application/json" \
-d '{
"image": "'"$IMAGE:${{ gitea.sha }}"'",
"commit": "${{ gitea.sha }}",
"repository": "${{ gitea.repository }}"
}' \
"${{ secrets.DEPLOY_WEBHOOK_URL }}"
+57 -31
View File
@@ -1,38 +1,64 @@
FROM php:8.2-apache FROM php:8.3-apache
RUN apt-get update \ RUN apt-get update && apt-get install -y \
&& apt-get -y install \ git \
g++ \ curl \
libcurl4-gnutls-dev \ libicu-dev \
libxml2-dev \ libzip-dev \
libxslt-dev \ libonig-dev \
libzip-dev \ libssh2-1 \
zlib1g-dev \ libssh2-1-dev \
msmtp \ && rm -rf /var/lib/apt/lists/*
unzip \
git \
locales \
--no-install-recommends \
&& docker-php-ext-install pdo pdo_mysql mysqli xsl xml zip opcache \
&& a2enmod rewrite proxy proxy_http headers \
&& apt-get purge -y g++ \
&& apt-get autoremove -y \
&& rm -r /var/lib/apt/lists/*
# Get latest Composer RUN pecl install ssh2 \
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer && docker-php-ext-enable ssh2 \
&& docker-php-ext-configure intl \
&& docker-php-ext-install \
pdo \
pdo_mysql \
mysqli \
intl \
ftp \
mbstring \
bcmath \
zip
# Update the default apache site with the config we created. RUN a2enmod rewrite
ADD docker/apache.conf /etc/apache2/sites-enabled/000-default.conf
WORKDIR /var/www/html COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
COPY . /var/www/html
WORKDIR /var/www/app WORKDIR /var/www/app
RUN mkdir -p storage/framework/{sessions,views,cache,cache/data} && \
chown -R www-data:www-data storage/framework && \
chmod -R 775 storage
#RUN php artisan cache:clear && \ ENV APACHE_DOCUMENT_ROOT=/var/www/app/public
# php artisan config:clear && \
# php artisan view:clear RUN sed -ri \
-e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' \
/etc/apache2/sites-available/*.conf \
/etc/apache2/apache2.conf \
/etc/apache2/conf-available/*.conf
RUN echo '<Directory /var/www/app/public>\n\
AllowOverride All\n\
Require all granted\n\
</Directory>' > /etc/apache2/conf-available/laravel.conf \
&& a2enconf laravel
COPY composer.json composer.lock ./
# Note: for Laravel, the COPY . . needs to be before the composer install
COPY . .
RUN composer install \
--no-dev \
--prefer-dist \
--no-interaction \
--optimize-autoloader
RUN mkdir -p \
storage/framework/cache/data \
storage/framework/sessions \
storage/framework/views \
&& chown -R www-data:www-data storage bootstrap/cache \
&& chmod -R ug+rwx storage bootstrap/cache
EXPOSE 80