From 4b68059cdc2f783abd5a73b05b3f3aa50c54fd34 Mon Sep 17 00:00:00 2001 From: Darren <27513732@qq.com> Date: Fri, 8 Dec 2023 15:32:24 +0800 Subject: [PATCH] test docker build --- .github/workflows/docker.yml | 16 +++++++++++++++- docker/apphub/Dockerfile | 22 +++++++++++++--------- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 50c05fad..6f90ba95 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -68,8 +68,22 @@ jobs: echo "DOCKERFILE=docker/$APP/Dockerfile" >> $GITHUB_ENV echo "DIRECTORY=docker/$APP" >> $GITHUB_ENV echo "README=docker/$APP/README.md" >> $GITHUB_ENV + + ##------------ special task for apphub begin----------------------# + - name: Trigger media.yml workflow + uses: benc-uk/workflow-dispatch@v1 + with: + workflow: Media Action + token: ${{ secrets.GITHUB_TOKEN }} + if: env.APP == 'apphub' - + - name: Download media.zip from artifacts + uses: actions/download-artifact@v2 + with: + name: media + path: ${{env.DIRECTORY}} + if: env.APP == 'apphub' + ##------------ special task for apphub end----------------------# - name: Build & push Docker image uses: mr-smithers-excellent/docker-build-push@v6 diff --git a/docker/apphub/Dockerfile b/docker/apphub/Dockerfile index f91da135..4f1afc28 100644 --- a/docker/apphub/Dockerfile +++ b/docker/apphub/Dockerfile @@ -1,4 +1,4 @@ -# modify time: 2023120081104, you can modify here to trigger Docker Build action +# modify time: 202312081532, you can modify here to trigger Docker Build action FROM python:3.10-slim-bullseye LABEL maintainer="Websoft9" @@ -9,23 +9,27 @@ WORKDIR /websoft9 ENV LIBRARY_VERSION=0.5.18 ENV MEDIA_VERSION=0.0.7 ENV websoft9_repo="https://github.com/Websoft9/websoft9" -ENV docker_library_repo="https://github.com/Websoft9/docker-library" -ENV media_repo="https://github.com/Websoft9/media" +ENV websoft9_artifact="https://w9artifact.blob.core.windows.net/release/websoft9" +ENV library_repo="https://github.com/Websoft9/docker-library" ENV source_github_pages="https://websoft9.github.io/websoft9" RUN apt update && apt install -y --no-install-recommends curl git jq cron iproute2 supervisor rsync wget unzip zip && \ - # Prepare source files - git clone --depth=1 $docker_library + # Prepare library + git clone --depth=1 $library_repo \ mv docker-library w9library && \ rm -rf w9library/.github && \ - wget $media_repo/archive/refs/tags/$MEDIA_VERSION.zip -O ./media.zip && \ - unzip media.zip && \ - mv media-* w9media && \ - rm -rf w9media/.github && \ + # Prepare media + if [ ! -f ./media.zip ]; then \ + wget $websoft9_artifact/plugin/media/media-latest.zip -O ./media.zip && \ + unzip media.zip \ + fi \ + mv media* w9media \ + git clone --depth=1 https://github.com/swagger-api/swagger-ui.git && \ wget https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js && \ cp redoc.standalone.js swagger-ui/dist && \ + git clone --depth=1 $websoft9_repo ./w9source && \ cp -r ./w9media ./media && \ cp -r ./w9library ./library && \