diff --git a/.github/workflow/main.yml b/.github/workflow/main.yml new file mode 100644 index 0000000..41413bc --- /dev/null +++ b/.github/workflow/main.yml @@ -0,0 +1,31 @@ +name: ci + +on: + push: + branches: + - "main" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/simple-http-server:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 9dbdab1..4347379 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ WORKDIR /build COPY . . # Build the application -RUN go build -o simple_http_server ./simple_http_server.go ./utils.go +RUN go build -o simple_http_server ./simple_http_server.go # Move to /dist directory as the place for resulting binary folder WORKDIR /dist