-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add dockerfile and actions to push image
- Loading branch information
1 parent
d796975
commit 7f0d99e
Showing
2 changed files
with
41 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Build Docker Image | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build: | ||
name: push docker image to docker hub | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: login to docker hub | ||
id: docker-hub | ||
env: | ||
username: ${{secrets.DOCKERHUB_USERNAME}} | ||
password: ${{secrets.DOCKERHUB_PASSWORD}} | ||
run: | | ||
docker login -u $username -p $password | ||
- name: build the docker image | ||
id: build-docker-image | ||
run: | | ||
ls -la | ||
docker build -t docker push ${{secrets.DOCKERHUB_USERNAME}}/s3khoj:latest | ||
- name: push the docker image | ||
id: push-docker-image | ||
run: docker push ${{secrets.DOCKERHUB_USERNAME}}/s3khoj:latest |
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,15 @@ | ||
# Build | ||
FROM golang:1.22-alpine AS build-env | ||
RUN apk add build-base | ||
WORKDIR /app | ||
COPY . /app | ||
RUN go mod tidy | ||
RUN go build -o S3Khoj main.go | ||
|
||
# Release | ||
FROM alpine:3.18.6 | ||
RUN apk upgrade --no-cache \ | ||
&& apk add --no-cache bind-tools | ||
COPY --from=build-env /app/S3Khoj /usr/local/bin/S3Khoj | ||
|
||
ENTRYPOINT [ "S3Khoj" ] |