Add CI workflow
All checks were successful
Build & Push Docker Image with Commit Hash Tag / build-and-push (push) Successful in 2m25s
All checks were successful
Build & Push Docker Image with Commit Hash Tag / build-and-push (push) Successful in 2m25s
This commit is contained in:
1
.dockerignore
Normal file
1
.dockerignore
Normal file
@ -0,0 +1 @@
|
|||||||
|
Dockerfile
|
39
.gitea/workflows/docker-build.yml
Normal file
39
.gitea/workflows/docker-build.yml
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
name: Build & Push Docker Image with Commit Hash Tag
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: docker
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: 📦 Cloner le dépôt
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: ⚙️ Récupérer le hash court du commit
|
||||||
|
id: vars
|
||||||
|
run: echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITEA_OUTPUT
|
||||||
|
|
||||||
|
- name: 🔐 Connexion au registre Docker (Gitea)
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ vars.REGISTRY_URL }}
|
||||||
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: ⚙️ Préparer Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: 🐳 Construire & pousser l’image avec Buildx
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ vars.REGISTRY_URL }}/${{ vars.REGISTRY_REPOSITORY }}:latest
|
||||||
|
${{ vars.REGISTRY_URL }}/${{ vars.REGISTRY_REPOSITORY }}:${{ steps.vars.outputs.COMMIT_HASH }}
|
||||||
|
platforms: linux/amd64
|
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
FROM php:8-apache
|
||||||
|
|
||||||
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
|
||||||
|
|
||||||
|
RUN chmod +x /usr/local/bin/install-php-extensions
|
||||||
|
|
||||||
|
RUN install-php-extensions imagick
|
||||||
|
|
||||||
|
RUN docker-php-ext-enable imagick
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y ffmpeg git wget unzip vim
|
||||||
|
|
||||||
|
RUN wget https://use.fontawesome.com/releases/v5.15.1/fontawesome-free-5.15.1-web.zip
|
||||||
|
RUN unzip fontawesome-free-5.15.1-web.zip
|
||||||
|
RUN rm fontawesome-free-5.15.1-web.zip
|
||||||
|
RUN mv fontawesome-free-5.15.1-web /var/www/html/fontawesome
|
||||||
|
|
||||||
|
COPY --from=composer/composer:latest-bin /composer /usr/bin/composer
|
||||||
|
WORKDIR /var/www/html/php
|
||||||
|
RUN composer require php-ffmpeg/php-ffmpeg
|
||||||
|
|
||||||
|
RUN install -d -m 0755 -o www-data -g www-data /var/www/html/uploads
|
Reference in New Issue
Block a user