forked from kreuzwerker/envplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update for single dockerfile-only build
- Loading branch information
1 parent
b42fbf9
commit d96c32d
Showing
27 changed files
with
79 additions
and
1,724 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,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 }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,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"] |
Oops, something went wrong.