Skip to content

Commit 8dfa348

Browse files
committed
added actions
1 parent 0fa08c5 commit 8dfa348

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

.github/workflow/main.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
-
13+
name: Checkout
14+
uses: actions/checkout@v4
15+
-
16+
name: Login to Docker Hub
17+
uses: docker/login-action@v3
18+
with:
19+
username: ${{ secrets.DOCKERHUB_USERNAME }}
20+
password: ${{ secrets.DOCKERHUB_TOKEN }}
21+
-
22+
name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
-
25+
name: Build and push
26+
uses: docker/build-push-action@v5
27+
with:
28+
context: .
29+
file: ./Dockerfile
30+
push: true
31+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/simple-http-server:latest

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ WORKDIR /build
1313
COPY . .
1414

1515
# Build the application
16-
RUN go build -o simple_http_server ./simple_http_server.go ./utils.go
16+
RUN go build -o simple_http_server ./simple_http_server.go
1717

1818
# Move to /dist directory as the place for resulting binary folder
1919
WORKDIR /dist

0 commit comments

Comments
 (0)