-
Notifications
You must be signed in to change notification settings - Fork 386
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github action for release (binary and docker)
- Loading branch information
Showing
4 changed files
with
75 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- '**' | ||
tags: | ||
- 'v*.*.*' | ||
# to be used by fork patch-releases ^^ | ||
- 'v*.*.*-*' | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@master | ||
with: | ||
go-version: 1.14.x | ||
|
||
- name: Prepare | ||
id: prepare | ||
run: | | ||
TAG=${GITHUB_REF#refs/tags/} | ||
echo ::set-output name=tag_name::${TAG} | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v1 | ||
with: | ||
version: latest | ||
args: release --rm-dist --timeout=1h | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
VERSION: ${{ steps.prepare.outputs.tag_name }} | ||
|
||
- name: set up buildx | ||
id: buildx | ||
uses: crazy-max/ghaction-docker-buildx@v1 | ||
with: | ||
version: latest | ||
|
||
- name: login to dockerhub | ||
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin | ||
|
||
- name: build (and publish) main image | ||
env: | ||
# fork friendly ^^ | ||
DOCKER_REPO: ${{ secrets.DOCKER_REPO }} | ||
run: | | ||
docker buildx build \ | ||
--platform linux/amd64,linux/arm64,linux/arm/v7 \ | ||
--build-arg VERSION=${{ steps.prepare.outputs.tag_name }} \ | ||
--push \ | ||
-t ${DOCKER_REPO:-dkron/dkron}:${{ steps.prepare.outputs.tag_name }} \ | ||
-t ${DOCKER_REPO:-dkron/dkron}:latest \ | ||
-f Dockerfile.hub \ | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
FROM alpine | ||
# syntax=docker/dockerfile:1.0-experimental | ||
FROM alpine:3.11 | ||
LABEL maintainer="Victor Castell <[email protected]>" | ||
ARG TARGETPLATFORM | ||
|
||
RUN set -x \ | ||
&& buildDeps='bash ca-certificates openssl tzdata' \ | ||
|
@@ -12,8 +14,8 @@ EXPOSE 8080 8946 | |
ENV SHELL /bin/bash | ||
WORKDIR /opt/local/dkron | ||
|
||
COPY dkron . | ||
COPY dkron-* ./ | ||
RUN --mount=target=/build tar xf /build/dist/dkron_*_$(echo ${TARGETPLATFORM} | tr '/' '_' | sed -e 's/arm_/arm/').tar.gz | ||
|
||
ENTRYPOINT ["/opt/local/dkron/dkron"] | ||
|
||
CMD ["--help"] |