parent
3e06fff966
commit
fa2841ff5b
@ -0,0 +1,52 @@
|
|||||||
|
name: Build and push docker image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 3.* # on push releast with tag 3.*
|
||||||
|
workflow_dispatch: # on button click
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker-build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
clean: false
|
||||||
|
submodules: "recursive"
|
||||||
|
- name: Setup Environments
|
||||||
|
id: envs
|
||||||
|
run: |
|
||||||
|
CLOUDREVE_LATEST_TAG=$(git tag -l --sort=-creatordate | head -n 1)
|
||||||
|
DOCKER_IMAGE="cloudreve/cloudreve"
|
||||||
|
|
||||||
|
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}"
|
||||||
|
TAGS="${DOCKER_IMAGE}:latest,${DOCKER_IMAGE}:${CLOUDREVE_LATEST_TAG}"
|
||||||
|
|
||||||
|
echo "CLOUDREVE_LATEST_TAG:${CLOUDREVE_LATEST_TAG}"
|
||||||
|
echo ::set-output name=tags::${TAGS}
|
||||||
|
# - name: Setup QEMU Emulator
|
||||||
|
# uses: docker/setup-qemu-action@master
|
||||||
|
# with:
|
||||||
|
# platforms: all
|
||||||
|
# - name: Setup Docker Buildx Command
|
||||||
|
# id: buildx
|
||||||
|
# uses: docker/setup-buildx-action@master
|
||||||
|
# - name: Login to Dockerhub
|
||||||
|
# uses: docker/login-action@v1
|
||||||
|
# with:
|
||||||
|
# username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
# password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
# - name: Build Docker Image and Push
|
||||||
|
# id: docker_build
|
||||||
|
# uses: docker/build-push-action@v2
|
||||||
|
# with:
|
||||||
|
# push: true
|
||||||
|
# builder: ${{ steps.buildx.outputs.name }}
|
||||||
|
# context: .
|
||||||
|
# file: ./Dockerfile
|
||||||
|
# platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||||
|
# tags: ${{ steps.envs.outputs.tags }}
|
||||||
|
# - name: Image Digest
|
||||||
|
# run: echo ${{ steps.docker_build.outputs.digest }}
|
@ -1,52 +0,0 @@
|
|||||||
name: Build and push docker image
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- 3.* # on push releast with tag 3.*
|
|
||||||
branches:
|
|
||||||
- master # every push on `master` branch
|
|
||||||
workflow_dispatch: # on button click
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
docker-build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
clean: false
|
|
||||||
submodules: "recursive"
|
|
||||||
- name: Setup Environments
|
|
||||||
id: envs
|
|
||||||
run: |
|
|
||||||
CLOUDREVE_LATEST_VERSION=$(git tag -l --sort=-creatordate | head -n 1)
|
|
||||||
DOCKER_IMAGE="cloudreve/cloudreve"
|
|
||||||
TAGS="${DOCKER_IMAGE}:latest,${DOCKER_IMAGE}:${CLOUDREVE_LATEST_VERSION}"
|
|
||||||
|
|
||||||
echo "CLOUDREVE_LATEST_VERSION:${CLOUDREVE_LATEST_VERSION}"
|
|
||||||
echo ::set-output name=tags::${TAGS}
|
|
||||||
- name: Setup QEMU Emulator
|
|
||||||
uses: docker/setup-qemu-action@master
|
|
||||||
with:
|
|
||||||
platforms: all
|
|
||||||
- name: Setup Docker Buildx Command
|
|
||||||
id: buildx
|
|
||||||
uses: docker/setup-buildx-action@master
|
|
||||||
- name: Login to Dockerhub
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
||||||
- name: Build Docker Image and Push
|
|
||||||
id: docker_build
|
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
with:
|
|
||||||
push: true
|
|
||||||
builder: ${{ steps.buildx.outputs.name }}
|
|
||||||
context: .
|
|
||||||
file: ./Dockerfile
|
|
||||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
|
||||||
tags: ${{ steps.envs.outputs.tags }}
|
|
||||||
- name: Image Digest
|
|
||||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
|
Loading…
Reference in new issue