From 8dfa348f483dc3ebe9936e4fd22c6c8bb6804f5d Mon Sep 17 00:00:00 2001 From: Paresh Pawar <25054775+pareshpawar@users.noreply.github.com> Date: Wed, 25 Oct 2023 17:18:32 +0000 Subject: [PATCH] added actions --- .github/workflow/main.yml | 31 +++++++++++++++++++++++++++++++ Dockerfile | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 .github/workflow/main.yml 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