From 37a6c0cb3796850ea657cb9bcba0ad27f71f71c0 Mon Sep 17 00:00:00 2001 From: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com> Date: Tue, 25 Jul 2023 12:29:54 -0400 Subject: [PATCH] Add release automation and bump go version in Dockerfile (#108) --- .github/workflows/release.yaml | 34 ++++++++++++++++++++++++++++++++++ Dockerfile | 2 +- Makefile | 2 +- 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..5388119 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,34 @@ +name: Docker Plugin Publish +on: + workflow_dispatch: null + release: + types: [ published ] +jobs: + oci_publish: + name: Build and publish the docker plugin + runs-on: ubuntu-latest + steps: + - name: Clone Repository + uses: actions/checkout@v3 + + - name: setup python 3 + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push to DockerHub + run: make deploy + env: + PLUGIN_VERSION: ${{ github.event.release.tag_name }} diff --git a/Dockerfile b/Dockerfile index 0bede82..4590e0a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.18.3-alpine as builder +FROM golang:1.20-alpine as builder ENV GO111MODULE=on ARG VERSION=0 COPY . /docker-volume-linode diff --git a/Makefile b/Makefile index 5796af6..1051f70 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ export GO111MODULE=on all: clean build -deploy: +deploy: $(PLUGIN_DIR) # workaround for plugin docker plugin rm -f ${PLUGIN_NAME} 2>/dev/null || true docker plugin create ${PLUGIN_NAME} ./$(PLUGIN_DIR)