Skip to content

Commit

Permalink
v0.17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
s0s01qp committed Jul 27, 2021
1 parent ee13b04 commit 675c3b6
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 2 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
paths:
- "version.json"

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
name: Build
Expand Down Expand Up @@ -63,4 +67,22 @@ jobs:
prerelease: false
title: ${{ steps.tag.outputs.new_tag }}
automatic_release_tag: ${{ steps.tag.outputs.new_tag }}
files: moxy-*/moxy-*
files: moxy-*/moxy-*
- name: Docker Login
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Metadata
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Docker publish
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
54 changes: 54 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Start from the latest alpine based golang base image
FROM golang:alpine as builder

# Build stamp argument
ARG buildstamp

# Git Commit Id
ARG gitCommitId

# Git Primary Branch
ARG gitPrimaryBranch

# Git Repository
ARG gitRepository

# Git username
ARG gitUsername

# Hostname
ARG hostname

# App Version
ARG appVersion

# Add maintainer info
LABEL maintainer="Shubham Sinha <[email protected]>"

# Set the current working directory inside the container
WORKDIR /app

# Copy go mod and sum files
COPY go.mod go.sum ./

# Download all dependencies
RUN go mod download

# Copy the source from the current directory to the working directory inside the container
COPY . .

# Build Moxy
RUN GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/sinhashubham95/go-actuator/core.BuildStamp=$buildstamp -X github.com/sinhashubham95/go-actuator/core.GitCommitID=$gitCommitId -X github.com/sinhashubham95/go-actuator/core.GitPrimaryBranch=$gitPrimaryBranch -X github.com/sinhashubham95/go-actuator/core.GitURL=https://github.com/$gitRepository -X github.com/sinhashubham95/go-actuator/core.Username=$gitUsername -X github.com/sinhashubham95/go-actuator/core.HostName=$hostname -X github.com/sinhashubham95/go-actuator/core.GitCommitTime=$buildstamp -X github.com/sinhashubham95/go-actuator/core.GitCommitAuthor=$gitUsername"

# Start again from scratch
FROM scratch

# Copy the binary
COPY --from=builder /app/moxy /moxy

# Set the working directory to data so all created files
# can be mapped to physical files on disk
WORKDIR /data

# Run binary
ENTRYPOINT ["../moxy", "--env=dev", "--name=moxy", "--version=$appVersion", "--port=$port", "--persistence-path=persistence.db"]
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "moxy",
"version": "0.16.0"
"version": "0.17.0"
}

0 comments on commit 675c3b6

Please sign in to comment.