From 7ecd38ad1fcdd11c719346cb03a6e1fc5b98f6ef Mon Sep 17 00:00:00 2001 From: hanhh <18330117883@163.com> Date: Thu, 1 Jul 2021 15:27:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker.yml | 21 +-------------------- docker/Dockerfile | 9 ++++----- 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 08714198..4330e547 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,9 +1,6 @@ name: Publish Docker Image on: - push: - branches: - - v* - - master + workflow_dispatch: jobs: build: @@ -33,19 +30,3 @@ jobs: if: github.ref == 'refs/heads/master' run: | docker buildx build --build-arg SSH_PRIVATE_KEY="${SSH_PRIVATE_KEY}" --output "type=image,push=true" --platform=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x --tag whyour/qinglong:latest docker/ - - - name: Replace branch without `v` - if: startsWith(github.ref, 'refs/heads/') && github.ref != 'refs/heads/master' - uses: actions/github-script@v1 - id: version - with: - script: | - return context.payload.ref.replace(/\/?refs\/heads\/v/, '') - result-encoding: string - - - name: Docker buildx image and push on release - env: - SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} - if: startsWith(github.ref, 'refs/heads/') && github.ref != 'refs/heads/master' - run: | - docker buildx build --build-arg SSH_PRIVATE_KEY="${SSH_PRIVATE_KEY}" --output "type=image,push=true" --platform=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x --tag whyour/qinglong:${{steps.version.outputs.result}} docker/ diff --git a/docker/Dockerfile b/docker/Dockerfile index e568cca2..ab61085d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -29,21 +29,20 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && echo "Asia/Shanghai" > /etc/timezone \ && touch ~/.bashrc \ && mkdir /run/nginx \ + && git clone -b ${QL_BRANCH} https://github.com/whyour/qinglong-static.git /static \ && git clone -b ${QL_BRANCH} ${QL_URL} ${QL_DIR} \ && git config --global user.email "qinglong@@users.noreply.github.com" \ && git config --global user.name "qinglong" \ && git config --global pull.rebase true \ && cd ${QL_DIR} \ + && cp -rf /static/* ./ \ + && rm -rf /static \ && cp -f .env.example .env \ && chmod 777 ${QL_DIR}/shell/*.sh \ && chmod 777 ${QL_DIR}/docker/*.sh \ && npm install -g pm2 \ && npm install -g pnpm \ && rm -rf /root/.npm \ - && pnpm install \ - && pnpm build \ - && pnpm build-back \ - && rm -rf node_modules \ && pnpm install --prod \ && rm -rf /root/.pnpm-store -ENTRYPOINT ["./docker/docker-entrypoint.sh"] +ENTRYPOINT ["./docker/docker-entrypoint.sh"] \ No newline at end of file