refactor to php composer
All checks were successful
Build, Push, Publish / Build & Release (push) Successful in 23m5s
All checks were successful
Build, Push, Publish / Build & Release (push) Successful in 23m5s
This commit is contained in:
@@ -1,45 +0,0 @@
|
||||
name: Update AWS SDK PHAR
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '34 3 * * *' # 03:34 UTC == 00:34 BRT
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
download-aws-sdk:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: catthehacker/ubuntu:act-latest
|
||||
permissions:
|
||||
contents: write
|
||||
actions: write # needed to dispatch another workflow
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download AWS SDK PHAR
|
||||
run: |
|
||||
mkdir -p vendor
|
||||
wget https://github.com/aws/aws-sdk-php/releases/latest/download/aws.phar -O vendor/aws.phar
|
||||
|
||||
- name: Commit and push changes
|
||||
id: commit_step
|
||||
run: |
|
||||
git config --global --add safe.directory '*'
|
||||
git config user.name "Gitea Actions"
|
||||
git config user.email "actions@git.icc.gg"
|
||||
git add vendor/aws.phar
|
||||
|
||||
# If there are changes, commit & push; set output flag accordingly
|
||||
if git diff --quiet && git diff --staged --quiet; then
|
||||
echo "No changes to commit"
|
||||
echo "changes_committed=false" >> $GITHUB_OUTPUT
|
||||
else
|
||||
git commit -m "Update AWS SDK PHAR [▶️]"
|
||||
git push origin HEAD:main
|
||||
echo "changes_committed=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
@@ -4,7 +4,7 @@ COPY composer.json composer.json
|
||||
# COPY composer.lock composer.lock # No lock file yet
|
||||
COPY auth_keycloak.php auth_keycloak.php
|
||||
COPY s3_client.php s3_client.php
|
||||
RUN composer install --no-dev --ignore-platform-reqs --no-scripts --prefer-dist
|
||||
RUN export COMPOSER_PROCESS_TIMEOUT=2000 && composer install --no-dev --ignore-platform-reqs --no-scripts --prefer-dist
|
||||
|
||||
# Stage 2: Final image
|
||||
FROM php:8.4-fpm-alpine
|
||||
@@ -17,7 +17,7 @@ RUN apk add --no-cache --update nginx \
|
||||
# Copy dependencies from vendor stage
|
||||
COPY --from=vendor /app/vendor /var/www/html/vendor
|
||||
# Copy aws.phar
|
||||
COPY vendor/aws.phar /var/www/html/vendor/aws.phar
|
||||
# aws.phar is now installed via composer
|
||||
|
||||
# Copy application code
|
||||
COPY . /var/www/html/
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
"php": "^8.2",
|
||||
"ext-pdo": "*",
|
||||
"ext-curl": "*",
|
||||
"ext-json": "*"
|
||||
"ext-json": "*",
|
||||
"aws/aws-sdk-php": "^3.0"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
// --- MariaDB Settings ---
|
||||
require_once __DIR__ . '/vendor/aws.phar';
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
define('DB_HOST', getenv('DB_SERVER') ?: '127.0.0.1');
|
||||
define('DB_NAME', getenv('DB_NAME') ?: 'YOURDBNAME');
|
||||
|
||||
BIN
vendor/aws.phar
vendored
BIN
vendor/aws.phar
vendored
Binary file not shown.
Reference in New Issue
Block a user