修改dockerfile

This commit is contained in:
hanhh 2021-07-01 15:27:13 +08:00
parent 4bc1deda42
commit 7ecd38ad1f
2 changed files with 5 additions and 25 deletions

View File

@ -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/

View File

@ -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"]