2022-05-26 21:58:35 +08:00
|
|
|
name: Publish Netclient-Userspace Docker
|
2022-05-24 00:12:35 +08:00
|
|
|
|
|
|
|
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
|
2022-11-10 23:52:44 +08:00
|
|
|
uses: actions/checkout@v3
|
2022-05-24 00:12:35 +08:00
|
|
|
-
|
|
|
|
name: Set up QEMU
|
2022-11-10 23:52:44 +08:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2022-05-24 00:12:35 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2022-11-10 23:52:44 +08:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2022-05-24 00:12:35 +08:00
|
|
|
-
|
|
|
|
name: Login to DockerHub
|
2022-11-10 23:52:44 +08:00
|
|
|
uses: docker/login-action@v2
|
2022-05-24 00:12:35 +08:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
-
|
|
|
|
name: Build and push
|
2022-11-14 21:56:12 +08:00
|
|
|
uses: docker/build-push-action@v3
|
2022-05-24 00:12:35 +08:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
platforms: linux/amd64
|
2022-05-26 21:58:35 +08:00
|
|
|
file: ./docker/Dockerfile-netclient-multiarch-userspace
|
2022-05-24 00:12:35 +08:00
|
|
|
push: true
|
2022-05-26 21:58:35 +08:00
|
|
|
tags: gravitl/netclient-go:${{ env.TAG }}, gravitl/netclient-userspace:latest
|
2022-05-24 00:12:35 +08:00
|
|
|
build-args: version=${{ env.TAG }}
|