2 Commits

Author SHA1 Message Date
Kamesh 1d4f887128 feat!: prepare and push release 2022-07-11 19:46:47 +05:30
Kamesh 6cb81ef2d3 remove auto release of image 2022-07-11 13:14:03 +05:30
3 changed files with 17 additions and 79 deletions
-46
View File
@@ -1,46 +0,0 @@
name: Release Image
on:
release:
types:
- released
workflow_dispatch:
env:
PLUGIN_IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/drone-vercel-deploy
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
id: docker-hub-login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Release Image
env:
TAG_NAME: ${{ github.event.release.tag_name }}
PLUGIN_IMAGE_NAME: ${{ env.PLUGIN_IMAGE_NAME }}
id: build-plugin-image
run: |
echo "Building Plugin Image Tag $TAG_NAME"
if [[ -z $TAG_NAME || "$TAG_NAME" == "undefined" ]];
then
TAG_NAME="latest"
fi
docker build \
--build-arg BUILDKIT_MULTI_PLATFORM=1 \
--platform=linux/amd64 \
--platform=linux/arm64 \
--push \
--tag $PLUGIN_IMAGE_NAME:$TAG \
-f docker/Dockerfile .
docker tag $PLUGIN_IMAGE_NAME:$TAG $PLUGIN_IMAGE_NAME
docker push $PLUGIN_IMAGE_NAME
-14
View File
@@ -1,14 +0,0 @@
on:
push:
branches:
- main
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
with:
release-type: simple
package-name: release-please-action
bump-minor-pre-major: true
+17 -19
View File
@@ -1,28 +1,26 @@
IMAGE?=kameshsampath/drone-vercel-deploy
TAG?=latest
SHELL := bash
CURRENT_DIR = $(shell pwd)
PLUGIN_IMAGE_NAME := docker.io/kameshsampath/drone-vercel-deploy
DRONE_FILE = .drone.yml
ENV_FILE := $(CURRENT_DIR)/.env
BUILDER=buildx-multi-arch
DOCKER_FILE=$(CURRENT_DIR)/docker/Dockerfile
build-and-load: ## Builds and loads the image into local docker context
@docker buildx build \
--tag $(PLUGIN_IMAGE_NAME) \
--load \
-f "$(CURRENT_DIR)/docker/Dockerfile" "$(CURRENT_DIR)"
prepare-buildx: ## Create buildx builder for multi-arch build, if not exists
docker buildx inspect $(BUILDER) || docker buildx create --name=$(BUILDER) --driver=docker-container --driver-opt=network=host
deploy-and-test: build-and-load ## Builds, loads the image into local docker and tests
@drone exec --secret-file="examples/nextjs-blog/secret.local" examples/nextjs-blog/.drone.yml
build-plugin: ## Build plugin image locally
docker build --tag=$(IMAGE):$(shell svu next) -f $(DOCKER_FILE) .
build-and-push: ## Builds and pushes the image to Container Registry
@docker buildx build \
--build-arg BUILDKIT_MULTI_PLATFORM=1 \
--platform=linux/amd64 \
--platform=linux/arm64 \
--push \
--metadata-file="$(CURRENT_DIR)/docker/metadata.json" \
--tag $(PLUGIN_IMAGE_NAME) \
-f "$(CURRENT_DIR)/docker/Dockerfile" "$(CURRENT_DIR)"
push-plugin: prepare-buildx ## Build & Upload extension image to hub. Do not push if tag already exists: TAG=$(svu c) make push-extension
docker pull $(IMAGE):$(shell svu c) && echo "Failure: Tag already exists" || docker buildx build --push --builder=$(BUILDER) --platform=linux/amd64,linux/arm64 --build-arg TAG=$(shell svu c) --tag=$(IMAGE):$(shell svu c) -f $(DOCKER_FILE) .
release:
git tag "$(shell svu next)"
git push --tags
help: ## Show this help
@echo Please specify a build target. The choices are:
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "$(INFO_COLOR)%-30s$(NO_COLOR) %s\n", $$1, $$2}'
.PHONY: build-and-load build-and-push
.PHONY: bin build-plugin push-plugin help