mirror of
https://github.com/criyle/go-judge.git
synced 2025-11-04 14:50:02 +08:00
Action docker
This commit is contained in:
parent
6055f165b5
commit
f5a84cd04a
56
.github/workflows/build.yml
vendored
56
.github/workflows/build.yml
vendored
@ -181,3 +181,59 @@ jobs:
|
|||||||
asset_path: executorserver
|
asset_path: executorserver
|
||||||
asset_name: executorserver-macOS-${{ matrix.GOARCH }}
|
asset_name: executorserver-macOS-${{ matrix.GOARCH }}
|
||||||
asset_content_type: application/octet-stream
|
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 }}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user