Skip to content

Commit

Permalink
update for single dockerfile-only build
Browse files Browse the repository at this point in the history
  • Loading branch information
tobybellwood committed Oct 18, 2023
1 parent b42fbf9 commit d96c32d
Show file tree
Hide file tree
Showing 27 changed files with 79 additions and 1,724 deletions.
3 changes: 0 additions & 3 deletions .env

This file was deleted.

28 changes: 0 additions & 28 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

35 changes: 0 additions & 35 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/build.yml

This file was deleted.

58 changes: 58 additions & 0 deletions .github/workflows/build_and_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build & Publish
on:
push:
branches:
- "main"
- "dev"
tags:
- 'v*.*.*'
pull_request:
branches:
- 'main'

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
${{ github.repository_owner }}/envplate
ghcr.io/${{ github.repository_owner }}/envplate
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
27 changes: 0 additions & 27 deletions .github/workflows/release.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/test.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .gitignore

This file was deleted.

39 changes: 0 additions & 39 deletions .goreleaser.yml

This file was deleted.

21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# syntax=docker/dockerfile:1
# Build docker-gen from scratch
FROM golang:1.21-alpine AS ep-builder

ARG VERSION=v1.0.3

ADD https://github.com/kreuzwerker/envplate.git#${VERSION} /build

WORKDIR /build

RUN go mod download -json

# Build the docker-gen executable
RUN CGO_ENABLED=0 go build -ldflags '-X main.buildVersion= -extldflags "-static"' -o ep ./bin/ep.go

FROM scratch

# Install docker-gen from build stage
COPY --from=ep-builder /build/ep /usr/local/bin/ep

ENTRYPOINT ["/usr/local/bin/ep"]
17 changes: 0 additions & 17 deletions Makefile

This file was deleted.

75 changes: 0 additions & 75 deletions bin/ep.go

This file was deleted.

Loading

0 comments on commit d96c32d

Please sign in to comment.