From 981bf6803262cfe86bf72e827d8ebac03122e3ab Mon Sep 17 00:00:00 2001 From: ScR4PP <95632351+JarcauCristian@users.noreply.github.com> Date: Wed, 15 Nov 2023 18:39:13 +0200 Subject: [PATCH 1/2] Create docker-image.yml --- .github/workflows/docker-image.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..39f4668 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag scr4pp/go_load_balancer:$(date +%s) From ef406e631b9f78ddabc9eecad29185e0c6942ecb Mon Sep 17 00:00:00 2001 From: ScR4PP <95632351+JarcauCristian@users.noreply.github.com> Date: Wed, 15 Nov 2023 18:59:03 +0200 Subject: [PATCH 2/2] Update docker-image.yml --- .github/workflows/docker-image.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 39f4668..58ec1f5 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -3,8 +3,6 @@ name: Docker Image CI on: push: branches: [ "main" ] - pull_request: - branches: [ "main" ] jobs: @@ -13,6 +11,17 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag scr4pp/go_load_balancer:$(date +%s) + - name: Check out the code + uses: actions/checkout@v3 + - name: Log in to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_PASSWORD }} + - name: Build image + run: docker build . --file Dockerfile --tag scr4pp/go_load_balancer:latest + - name: Push Image + uses: docker/build-push-action@v2 + with: + push: true + tags: scr4pp/go_load_balancer:latest