From 52a91ff76c679fba5daf5ba4e3d532ff17432c68 Mon Sep 17 00:00:00 2001 From: Tung Leo Date: Tue, 27 Feb 2024 23:51:04 +0700 Subject: [PATCH 1/3] ci: 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..d657a63 --- /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 my-image-name:$(date +%s) From aca4b3c674ecc5b4fcf03c4c95b9bc26f229f8f9 Mon Sep 17 00:00:00 2001 From: Tung Leo Date: Tue, 27 Feb 2024 23:52:36 +0700 Subject: [PATCH 2/3] ci: Update image name in docker-image.yml --- .github/workflows/docker-image.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index d657a63..0ce2f35 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -7,12 +7,9 @@ on: branches: [ "main" ] jobs: - build: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - name: Build the Docker image - run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) + run: docker build . --file Dockerfile --tag devops-toolkit-review:$(date +%s) From 917cdd25688a6e0b90d4326564f03d2cbab3c52a Mon Sep 17 00:00:00 2001 From: Tung Leo Date: Tue, 27 Feb 2024 23:55:19 +0700 Subject: [PATCH 3/3] ci: run on PR only --- .github/workflows/docker-image.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 0ce2f35..c83d262 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,8 +1,6 @@ name: Docker Image CI on: - push: - branches: [ "main" ] pull_request: branches: [ "main" ]