[docker] set BUILD_TIME/BUILD_HASH vars

This commit is contained in:
Shish 2023-12-31 14:45:39 +00:00
parent 89a61d3499
commit 42fc180c25
4 changed files with 13 additions and 4 deletions

View file

@ -16,7 +16,12 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' || github.event_name == 'push' }}
steps:
- uses: actions/checkout@master
- name: Checkout
uses: actions/checkout@master
- name: Set build vars
run: |
echo "BUILD_TIME=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
echo "BUILD_HASH=$GITHUB_SHA" >> $GITHUB_ENV
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@main
with:
@ -25,4 +30,5 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}
cache: ${{ github.event_name != 'schedule' }}
buildoptions: "--build-arg RUN_TESTS=false"
buildargs: BUILD_TIME,BUILD_HASH
tag_semver: true

View file

@ -53,7 +53,8 @@ EXPOSE 8000
FROM base AS run
EXPOSE 8000
# HEALTHCHECK --interval=1m --timeout=3s CMD curl --fail http://127.0.0.1:8000/ || exit 1
ENV UID=1000 GID=1000 UPLOAD_MAX_FILESIZE=50M
ARG BUILD_TIME=unknown BUILD_HASH=unknown
ENV UID=1000 GID=1000 UPLOAD_MAX_FILESIZE=50M BUILD_TIME=${BUILD_TIME} BUILD_HASH=${BUILD_HASH}
COPY --from=build /app /app
WORKDIR /app
ENTRYPOINT ["/app/.docker/entrypoint.sh"]

View file

@ -527,7 +527,7 @@ class BasePage
print <<<EOD
<!doctype html>
<html class="no-js" lang="en">
<html lang="en">
$head_html
$body_html
</html>

View file

@ -21,7 +21,9 @@ function _load_event_listeners(): void
{
global $_shm_event_listeners;
$cache_path = data_path("cache/shm_event_listeners.php");
$key = md5(Extension::get_enabled_extensions_as_string());
$cache_path = data_path("cache/shm_event_listeners.$key.php");
if (SPEED_HAX && file_exists($cache_path)) {
require_once($cache_path);
} else {