From f5a84cd04a6f9e0da821ae225345ac3e0e13fa5d Mon Sep 17 00:00:00 2001 From: criyle Date: Wed, 30 Dec 2020 13:23:19 -0800 Subject: [PATCH] Action docker --- .github/workflows/build.yml | 56 +++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 20e924f..a49630a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -181,3 +181,59 @@ jobs: asset_path: executorserver asset_name: executorserver-macOS-${{ matrix.GOARCH }} asset_content_type: application/octet-stream + docker: + runs-on: ubuntu-latest + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + context: . + push: ${{ contains(github.ref, 'v') }} + file: Dockerfile.exec + platforms: linux/amd64,linux/arm64,linux/arm/v7 + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + tags: | + criyle/executorserver:latest + criyle/executorserver:${{ github.ref }} + - + name: Build and push alpine + id: docker_build_alpine + uses: docker/build-push-action@v2 + with: + context: . + push: ${{ contains(github.ref, 'v') }} + file: Dockerfile.alpine + platforms: linux/amd64,linux/arm64,linux/arm/v7 + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + tags: | + criyle/executorserver:${{ github.ref }}-alpine + - + name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} + - + name: Image digest alpine + run: echo ${{ steps.docker_build_alpine.outputs.digest }}