Skip to content

Commit

Permalink
feat: add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
yasinmiran committed Oct 9, 2024
1 parent 4c2b392 commit 76dcfa5
Show file tree
Hide file tree
Showing 7 changed files with 370 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[bumpversion]
current_version = 1.0.0
commit = True
tag = True

[bumpversion:file:pyproject.toml]
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
venv
build.gradle.kts
poetry.lock
README.md
56 changes: 56 additions & 0 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Bump Version and Publish Docker Image

on:
push:
branches:
- main # Runs on pushes to the main branch
workflow_dispatch:

permissions:
packages: write
contents: read

jobs:
bump_version:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Poetry
run: |
pip install poetry
poetry install
- name: Install bump2version
run: |
pip install bump2version
- name: Bump Version
id: bumpversion
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
bump2version patch # You can change this to minor or major
git push --follow-tags
build_and_push:
runs-on: ubuntu-latest
needs: bump_version # Wait for the version bump job to finish
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker image
uses: docker/build-push-action@v5
with:
context: .
tags: |
ghcr.io/ELIXIR-NO/pipeline-heartbeat:${{ github.ref_name }} # Image tagged with Git ref
ghcr.io/ELIXIR-NO/pipeline-heartbeat:latest # Always update 'latest'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.idea
venv
bin

282 changes: 282 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[tool.poetry]
name = "pipeline-heartbeat"
version = "1.0.0"
description = ""
authors = ["Yasin <[email protected]>"]
license = "MIT"
readme = "README.md"
package-mode = false

[tool.poetry.dependencies]
python = "^3.10"
loguru = "0.7.2"
pika = "1.3.2"
requests = "~2.32.3"
redis = "~5.1.0"

[tool.poetry.group.dev.dependencies]
bump2version = "^1.0.1"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

0 comments on commit 76dcfa5

Please sign in to comment.