Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add a simple DockerFile and runner test #87

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/dockerfile_workflow_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Build Using Reusable Workflow
on: [push, pull_request]
jobs:
reusable-build:
uses: celestiaorg/.github/.github/workflows/reusable_dockerfile_pipeline.yml@${{ github.event.pull_request.head.ref || 'main' }}
with:
dockerfile: docker-action-test/Dockerfile
packageName: docker-action-test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea/
.vscode/
20 changes: 20 additions & 0 deletions docker-action-test/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM --platform=$BUILDPLATFORM docker.io/golang:1.21-alpine3.18 as builder

ARG TARGETOS
ARG TARGETARCH

ENV CGO_ENABLED=0
ENV GO111MODULE=on

ADD . /app
WORKDIR /app

RUN uname -a &&\
CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o main .
######## Start a new stage from scratch #######
FROM docker.io/alpine:3.18.4

RUN apk update && apk add --no-cache bash curl jq
COPY --from=builder /app/main .
# Command to run the executable
CMD ["./main"]
3 changes: 3 additions & 0 deletions docker-action-test/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/celestiaorg/.celestia-github/docker-action-test

go 1.21
7 changes: 7 additions & 0 deletions docker-action-test/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "fmt"

func main() {
fmt.Println("Docker CICD! ⚙️ ")
}