2022-01-24 00:31:17 +08:00
|
|
|
name: Publish Netclient Docker
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
tag:
|
|
|
|
description: 'docker tag'
|
|
|
|
required: true
|
|
|
|
release:
|
|
|
|
types: [published]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
docker:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Set tag
|
|
|
|
run: |
|
|
|
|
if [[ -n "${{ github.event.inputs.tag }}" ]]; then
|
|
|
|
TAG=${{ github.event.inputs.tag }}
|
|
|
|
elif [[ "${{ github.ref_name }}" == 'master' ]]; then
|
|
|
|
TAG="latest"
|
|
|
|
else
|
|
|
|
TAG="${{ github.ref_name }}"
|
|
|
|
fi
|
|
|
|
echo "TAG=${TAG}" >> $GITHUB_ENV
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
-
|
|
|
|
name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
-
|
|
|
|
name: Login to DockerHub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
-
|
|
|
|
name: Build x86 and export to Docker
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
load: true
|
|
|
|
platforms: linux/amd64
|
2022-02-13 01:55:22 +08:00
|
|
|
file: ./docker/Dockerfile-netclient-multiarch
|
2022-01-24 00:31:17 +08:00
|
|
|
tags: ${{ env.TAG }}
|
2022-02-13 01:55:22 +08:00
|
|
|
build-args: version=${{ env.TAG }}
|
2022-01-24 00:31:17 +08:00
|
|
|
-
|
|
|
|
name: Test x86
|
|
|
|
run: |
|
|
|
|
docker run --rm ${{ env.TAG }}&
|
|
|
|
sleep 10
|
|
|
|
kill %1
|
|
|
|
-
|
2022-09-22 19:48:45 +08:00
|
|
|
name: Build arm64 and export to Docker
|
2022-01-24 00:31:17 +08:00
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
load: true
|
|
|
|
platforms: linux/arm64
|
2022-02-13 01:55:22 +08:00
|
|
|
file: ./docker/Dockerfile-netclient-multiarch
|
2022-01-24 00:31:17 +08:00
|
|
|
tags: ${{ env.TAG }}
|
2022-02-13 01:55:22 +08:00
|
|
|
build-args: version=${{ env.TAG }}
|
2022-01-24 00:31:17 +08:00
|
|
|
-
|
2022-09-22 19:48:45 +08:00
|
|
|
name: Test arm64
|
|
|
|
run: |
|
|
|
|
docker run --rm ${{ env.TAG }}&
|
|
|
|
sleep 10
|
|
|
|
kill %1
|
|
|
|
-
|
|
|
|
name: Build armv7l and export to Docker
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
load: true
|
|
|
|
platforms: linux/armv7l
|
|
|
|
file: ./docker/Dockerfile-netclient-multiarch
|
|
|
|
tags: ${{ env.TAG }}
|
|
|
|
build-args: version=${{ env.TAG }}
|
|
|
|
-
|
|
|
|
name: Test armv7l
|
2022-01-24 00:31:17 +08:00
|
|
|
run: |
|
|
|
|
docker run --rm ${{ env.TAG }}&
|
|
|
|
sleep 10
|
|
|
|
kill %1
|
|
|
|
-
|
|
|
|
name: Build and push
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
2022-09-22 19:48:45 +08:00
|
|
|
platforms: linux/amd64, linux/arm64, linux/armv7l
|
2022-02-15 00:17:18 +08:00
|
|
|
file: ./docker/Dockerfile-netclient-multiarch
|
2022-01-24 00:31:17 +08:00
|
|
|
push: true
|
2022-03-18 06:36:56 +08:00
|
|
|
tags: gravitl/netclient:${{ env.TAG }}, gravitl/netclient:latest
|
2022-02-13 01:55:22 +08:00
|
|
|
build-args: version=${{ env.TAG }}
|