diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index d48106d..d8a7380 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,7 +1,10 @@ name: Docker Image CI on: - workflow_dispatch: # 允许手动触发 + workflow_dispatch: # 允许手动触发 + push: # 允许推送触发 + branches: + - main jobs: build: diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 4bb6902..c39f120 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -42,18 +42,17 @@ sed -i 's/#LoadModule\ expires_module/LoadModule\ expires_module/' /etc/apache2/ sed -i "s/memory_limit = .*/memory_limit = ${PHP_MEMORY_LIMIT}/" /etc/php83/php.ini sed -i "s#^;date.timezone =\$#date.timezone = \"${TZ}\"#" /etc/php83/php.ini - -# Change ownership of /htdocs/epg -chown -R apache:apache /htdocs/epg - # Check if /htdocs/epg/data/config.json exists echo 'Checking if /htdocs/epg/data/config.json exists' if [ ! -f /htdocs/epg/data/config.json ]; then echo 'config.json not found, copying default config' # If it does not exist, use config_default.json - cp /htdocs/epg/config_default.json /htdocs/epg/data/config.json + mkdir -p /htdocs/epg/data && cp -p /htdocs/epg/config_default.json /htdocs/epg/data/config.json fi +# Change ownership of /htdocs/epg +chown -R apache:apache /htdocs/epg + echo 'Running cron.php and Apache' # Start cron.php