From 21ceaf25c4e1192d22a41735b14fbcec62cc0085 Mon Sep 17 00:00:00 2001 From: rajashanmugamjm Date: Sun, 18 Aug 2024 21:19:22 +0530 Subject: [PATCH 1/4] feat: feat: ci config added for automatic container image generation and push to dockerhub --- .cz.toml | 7 ++++++ .github/workflows/deploy.yaml | 41 +++++++++++++++++++++++++++++++++++ .pre-commit-config.yaml | 8 +++++++ 3 files changed, 56 insertions(+) create mode 100644 .cz.toml create mode 100644 .github/workflows/deploy.yaml create mode 100644 .pre-commit-config.yaml diff --git a/.cz.toml b/.cz.toml new file mode 100644 index 0000000..d98e25c --- /dev/null +++ b/.cz.toml @@ -0,0 +1,7 @@ +[tool.commitizen] +name = "cz_conventional_commits" +tag_format = "$version" +version_scheme = "semver" +version = "0.0.1" +update_changelog_on_bump = true +major_version_zero = true diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..7956062 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,41 @@ +# +name: Create and publish image for iPaark API + +on: + push: + branches: + - develop + tags: + - '*' +jobs: + + build-and-push-image: + name: Build image and push to dockerhub + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + # + steps: + - name: Check out the repo + uses: actions/checkout@v4 + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: teamifour/ipk-api + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..08d091e --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,8 @@ +repos: +- hooks: + - id: commitizen + - id: commitizen-branch + stages: + - push + repo: https://github.com/commitizen-tools/commitizen + rev: v3.27.0 From 4a4d3ee2419d74e94fdd18770cfe944ef39835f6 Mon Sep 17 00:00:00 2001 From: rajashanmugamjm Date: Sun, 18 Aug 2024 21:23:10 +0530 Subject: [PATCH 2/4] refactor: ci configs updated --- .github/workflows/deploy.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 7956062..6c46038 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -3,10 +3,10 @@ name: Create and publish image for iPaark API on: push: - branches: - - develop - tags: - - '*' +# branches: +# - develop +# tags: +# - '*' jobs: build-and-push-image: From 21890c78b580501d939bded4e08375d0985bb914 Mon Sep 17 00:00:00 2001 From: rajashanmugamjm Date: Sun, 18 Aug 2024 21:26:52 +0530 Subject: [PATCH 3/4] fix: ci configs corrected --- .github/workflows/deploy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 6c46038..b2d2061 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -1,5 +1,5 @@ # -name: Create and publish image for iPaark API +name: Create and publish dt_fl_table image on: push: @@ -28,7 +28,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: teamifour/ipk-api + images: devdualtone/dt_fl_table tags: | type=ref,event=branch type=semver,pattern={{version}} From 47f549b6068241f28e90b17fc2e2da7128e778ca Mon Sep 17 00:00:00 2001 From: rajashanmugamjm Date: Sun, 18 Aug 2024 21:37:54 +0530 Subject: [PATCH 4/4] ci: config updated to trigger only on tag creation and on develop branch --- .github/workflows/deploy.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index b2d2061..8ab1475 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -3,10 +3,10 @@ name: Create and publish dt_fl_table image on: push: -# branches: -# - develop -# tags: -# - '*' + branches: + - develop + tags: + - '*' jobs: build-and-push-image: