github.com/cloudreve/Cloudreve/v3@v3.0.0-20240224133659-3edb00a6484c/.github/workflows/docker-release.yml (about)

     1  name: Build and push docker image
     2  
     3  on:
     4    push:
     5      tags:
     6        - 3.* # triggered on every push with tag 3.*
     7    workflow_dispatch: # or just on button clicked
     8  
     9  jobs:
    10    docker-build:
    11      runs-on: ubuntu-latest
    12      steps:
    13        - name: Checkout
    14          uses: actions/checkout@v2
    15        - run: git fetch --prune --unshallow
    16        - name: Setup Environments
    17          id: envs
    18          run: |
    19            CLOUDREVE_LATEST_TAG=$(git describe --tags --abbrev=0)
    20            DOCKER_IMAGE="cloudreve/cloudreve"
    21  
    22            echo "RELEASE_VERSION=${GITHUB_REF#refs}"
    23            TAGS="${DOCKER_IMAGE}:latest,${DOCKER_IMAGE}:${CLOUDREVE_LATEST_TAG}"
    24  
    25            echo "CLOUDREVE_LATEST_TAG:${CLOUDREVE_LATEST_TAG}"
    26            echo ::set-output name=tags::${TAGS}
    27        - name: Setup QEMU Emulator
    28          uses: docker/setup-qemu-action@master
    29          with:
    30            platforms: all
    31        - name: Setup Docker Buildx Command
    32          id: buildx
    33          uses: docker/setup-buildx-action@master
    34        - name: Login to Dockerhub
    35          uses: docker/login-action@v1
    36          with:
    37            username: ${{ secrets.DOCKERHUB_USERNAME }}
    38            password: ${{ secrets.DOCKERHUB_PASSWORD }}
    39        - name: Build Docker Image and Push
    40          id: docker_build
    41          uses: docker/build-push-action@v2
    42          with:
    43            push: true
    44            builder: ${{ steps.buildx.outputs.name }}
    45            context: .
    46            file: ./Dockerfile
    47            platforms: linux/amd64,linux/arm64,linux/arm/v7
    48            tags: ${{ steps.envs.outputs.tags }}
    49        - name: Update Docker Hub Description
    50          uses: peter-evans/dockerhub-description@v3
    51          with:
    52            username: ${{ secrets.DOCKERHUB_USERNAME }}
    53            password: ${{ secrets.DOCKERHUB_PASSWORD }}
    54            repository: cloudreve/cloudreve
    55            short-description: ${{ github.event.repository.description }}
    56        - name: Image Digest
    57          run: echo ${{ steps.docker_build.outputs.digest }}