mirror of
https://github.com/whyour/qinglong.git
synced 2025-07-07 20:06:08 +08:00
添加docker.yml
This commit is contained in:
parent
6e4648d709
commit
bdffd7d402
47
.github/workflows/docker.yml
vendored
Normal file
47
.github/workflows/docker.yml
vendored
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
name: Publish Docker Image
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Checkout base
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
# https://github.com/docker/setup-qemu-action
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
# https://github.com/docker/setup-buildx-action
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: Docker login
|
||||||
|
env:
|
||||||
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
run: |
|
||||||
|
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin
|
||||||
|
|
||||||
|
- name: Docker buildx image and push on master branch
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
run: |
|
||||||
|
docker buildx build --output "type=image,push=true" --platform=linux/amd64,linux/arm/v7,linux/arm64 --tag whyour/qinglong:latest docker/
|
||||||
|
|
||||||
|
- name: Replace tag without `v`
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
uses: actions/github-script@v1
|
||||||
|
id: version
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
return context.payload.ref.replace(/\/?refs\/tags\/v/, '')
|
||||||
|
result-encoding: string
|
||||||
|
|
||||||
|
- name: Docker buildx image and push on release
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
run: |
|
||||||
|
docker buildx build --output "type=image,push=true" --platform=linux/amd64,linux/arm/v7,linux/arm64 --tag whyour/qinglong:${{steps.version.outputs.result}} docker/
|
||||||
|
docker buildx build --output "type=image,push=true" --platform=linux/amd64,linux/arm/v7,linux/arm64 --tag whyour/qinglong:latest docker/
|
|
@ -42,7 +42,7 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||||
&& ln -sf ${JD_DIR}/shell/git_diy.sh /usr/local/bin/diy \
|
&& ln -sf ${JD_DIR}/shell/git_diy.sh /usr/local/bin/diy \
|
||||||
&& ln -sf ${JD_DIR}/shell/notify.sh /usr/local/bin/notify \
|
&& ln -sf ${JD_DIR}/shell/notify.sh /usr/local/bin/notify \
|
||||||
&& ln -sf ${JD_DIR}/shell/rebuild.sh /usr/local/bin/rebuild \
|
&& ln -sf ${JD_DIR}/shell/rebuild.sh /usr/local/bin/rebuild \
|
||||||
&& yarn install \
|
&& yarn install --network-timeout 100000 \
|
||||||
&& yarn build \
|
&& yarn build \
|
||||||
&& yarn build-back \
|
&& yarn build-back \
|
||||||
&& git clone -b ${JD_SCRIPTS_BRANCH} ${JD_SCRIPTS_URL} ${JD_DIR}/scripts \
|
&& git clone -b ${JD_SCRIPTS_BRANCH} ${JD_SCRIPTS_URL} ${JD_DIR}/scripts \
|
||||||
|
|
Loading…
Reference in New Issue
Block a user