You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by to...@apache.org on 2021/04/16 05:42:59 UTC

[apisix-docker] branch master updated: feat: automate upload image to Dockerhub (#159)

This is an automated email from the ASF dual-hosted git repository.

tokers pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-docker.git


The following commit(s) were added to refs/heads/master by this push:
     new 155cd24  feat: automate upload image to Dockerhub (#159)
155cd24 is described below

commit 155cd24fb9fd8cb28b7bd643b5dd4fd740cc4511
Author: qian0817 <qi...@gmail.com>
AuthorDate: Fri Apr 16 13:42:50 2021 +0800

    feat: automate upload image to Dockerhub (#159)
---
 .github/workflows/apisix_push_docker_hub.yaml    | 24 ++++++++++++++++++++++++
 .github/workflows/dashboard_push_docker_hub.yaml | 19 +++++++++++++++++++
 Makefile                                         | 16 ++++++++++++++--
 3 files changed, 57 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/apisix_push_docker_hub.yaml b/.github/workflows/apisix_push_docker_hub.yaml
new file mode 100644
index 0000000..abf3b6c
--- /dev/null
+++ b/.github/workflows/apisix_push_docker_hub.yaml
@@ -0,0 +1,24 @@
+name: Push apisix to Docker image
+on:
+  release:
+    types: [ published ]
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        platform:
+          - alpine
+          - centos
+
+    steps:
+      - name: Check out the repo
+        uses: actions/checkout@v2
+
+      - name: Login
+        run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login --username=${{ secrets.DOCKER_USERNAME }} --password-stdin
+
+      - name: Push apisix image to Docker Hub
+        run:
+          make build-on-${{ matrix.platform }}
+          make push-on-${{ matrix.platform }}
diff --git a/.github/workflows/dashboard_push_docker_hub.yaml b/.github/workflows/dashboard_push_docker_hub.yaml
new file mode 100644
index 0000000..9db5c52
--- /dev/null
+++ b/.github/workflows/dashboard_push_docker_hub.yaml
@@ -0,0 +1,19 @@
+name: Push apisix dashboard to Docker image
+on:
+  release:
+    types: [ published ]
+jobs:
+  build:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Check out the repo
+        uses: actions/checkout@v2
+
+      - name: Login
+        run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login --username=${{ secrets.DOCKER_USERNAME }} --password-stdin
+
+      - name: Push apisix dashboard image to Docker Hub
+        run:
+          make build-on-dashboard
+          make push-on-dashboard
diff --git a/Makefile b/Makefile
index a14f0c8..9294026 100644
--- a/Makefile
+++ b/Makefile
@@ -38,12 +38,20 @@ build-on-alpine:
 build-on-alpine-local:
 	docker build -t $(IMAGE_NAME):$(APISIX_VERSION)-alpine-local --build-arg APISIX_PATH=${APISIX_PATH} -f ./alpine-local/Dockerfile .	
 
+### push-on-centos:       Push apache/apisix:xx-centos image
+push-on-centos:
+	docker push $(IMAGE_NAME):$(APISIX_VERSION)-centos
+
+### push-on-alpine:       Push apache/apisix:xx-alpine image
+push-on-alpine:
+	docker push $(IMAGE_NAME):$(APISIX_VERSION)-alpine
+
 ### save-centos-tar:      tar apache/apisix:xx-centos image
 save-centos-tar:
 	mkdir -p package
 	docker save -o ./package/$(IMAGE_TAR_NAME)_$(APISIX_VERSION)-centos.tar $(IMAGE_NAME):$(APISIX_VERSION)-centos
 
-### save-alpine-tar:      tar apaceh/apisix:xx-alpine image
+### save-alpine-tar:      tar apache/apisix:xx-alpine image
 save-alpine-tar:
 	mkdir -p package
 	docker save -o ./package/$(IMAGE_TAR_NAME)_$(APISIX_VERSION)-alpine.tar $(IMAGE_NAME):$(APISIX_VERSION)-alpine
@@ -52,7 +60,11 @@ save-alpine-tar:
 build-dashboard:
 	docker build -t $(APISIX_DASHBOARD_IMAGE_NAME):$(APISIX_DASHBOARD_VERSION) -f ./dashboard/Dockerfile .
 
-### save-dashboard-tar:      tar apaceh/apisix-dashboard:tag image
+### push-dashboard:     Push apache/dashboard:tag image
+push-dashboard:
+	docker push $(APISIX_DASHBOARD_IMAGE_NAME):$(APISIX_DASHBOARD_VERSION)
+
+### save-dashboard-tar:      tar apache/apisix-dashboard:tag image
 save-dashboard-tar:
 	mkdir -p package
 	docker save -o ./package/$(APISIX_DASHBOARD_IMAGE_TAR_NAME)_$(APISIX_DASHBOARD_VERSION).tar $(APISIX_DASHBOARD_IMAGE_NAME):$(APISIX_DASHBOARD_VERSION)