From 5b62c5cba3657290ce2cf066a48a780be76c811a Mon Sep 17 00:00:00 2001 From: aadil96 Date: Thu, 20 Nov 2025 13:33:17 +0000 Subject: [PATCH 1/5] feat(backend): push release image to github container registery --- .github/workflows/docker-build-push.yaml | 43 ++++++++++++++++++++++++ src/backend/src/backend/main.py | 1 + 2 files changed, 44 insertions(+) create mode 100644 .github/workflows/docker-build-push.yaml diff --git a/.github/workflows/docker-build-push.yaml b/.github/workflows/docker-build-push.yaml new file mode 100644 index 0000000..6d6ccaa --- /dev/null +++ b/.github/workflows/docker-build-push.yaml @@ -0,0 +1,43 @@ +name: Build and Push Docker Images +on: + push: + tags: + - "backend*" +env: + REGISTRY: ghcr.io + BACKEND_IMAGE_NAME: ${{ github.repository_owner }}/study-app-api +jobs: + build-and-push-backend: + name: Build and Push Backend + runs-on: ubuntu-latest + # Only run for backend tags + if: contains(github.ref, 'backend') + permissions: + contents: read + packages: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract tag name + id: tag + run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT + + - name: Build and push Backend Docker image + uses: docker/build-push-action@v5 + with: + context: ./src/backend + push: true + tags: | + ${{ env.REGISTRY }}/${{ env.BACKEND_IMAGE_NAME }}:${{ steps.tag.outputs.TAG }} + ${{ env.REGISTRY }}/${{ env.BACKEND_IMAGE_NAME }}:latest + outputs: + tag: ${{ steps.tag.outputs.TAG }} + app: backend diff --git a/src/backend/src/backend/main.py b/src/backend/src/backend/main.py index e346e16..4bd6961 100644 --- a/src/backend/src/backend/main.py +++ b/src/backend/src/backend/main.py @@ -98,6 +98,7 @@ async def read_stats(): # Marker for CI pipeline # This comment is used to trigger the CI pipeline when changes are made to this file. +# This comment is used to trigger the CI pipeline when changes are made to this file. def main(): From 78a2b0e2585e832378b715d44b34f88b299a1e60 Mon Sep 17 00:00:00 2001 From: aadil96 Date: Thu, 20 Nov 2025 14:12:17 +0000 Subject: [PATCH 2/5] feat(frontend): push frontend image to github container registry --- .release-please-manifest.json | 3 ++- release-please-config.json | 14 ++++++++++++++ src/frontend/src/frontend/main.py | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 059fbae..219c0ca 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,4 @@ { - "src/backend": "0.2.0" + "src/backend": "0.2.0", + "src/frontend": "0.0.0" } diff --git a/release-please-config.json b/release-please-config.json index 9f531ed..c860317 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -13,6 +13,20 @@ "jsonpath": "$.package[?(@.name.value=='study-tracker-backend')].version" } ] + }, + "src/frontend": { + "release-type": "python", + "package-name": "study-tracker-frontend", + "component": "backend", + "include-component-in-tag": true, + "changelog-path": "CHANGELOG.md", + "extra-files": [ + { + "type": "toml", + "path": "uv.lock", + "jsonpath": "$.package[?(@.name.value=='study-tracker-frontend')].version" + } + ] } } } diff --git a/src/frontend/src/frontend/main.py b/src/frontend/src/frontend/main.py index 3719fb5..9d1382c 100644 --- a/src/frontend/src/frontend/main.py +++ b/src/frontend/src/frontend/main.py @@ -30,6 +30,7 @@ def format_session(session: Dict[str, Any]) -> Dict[str, Any]: return session +# Helper functions for API calls # Helper functions for API calls def get_sessions() -> List[Dict[str, Any]]: """Get all study sessions from the API""" From 5bdf0f60a6a341897f68addfd49ad3fb22f4c734 Mon Sep 17 00:00:00 2001 From: aadil96 Date: Thu, 20 Nov 2025 14:24:58 +0000 Subject: [PATCH 3/5] feat(frontend): push frontend image to github container registry --- .github/workflows/docker-build-push.yaml | 43 ++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/.github/workflows/docker-build-push.yaml b/.github/workflows/docker-build-push.yaml index 6d6ccaa..2583c50 100644 --- a/.github/workflows/docker-build-push.yaml +++ b/.github/workflows/docker-build-push.yaml @@ -1,20 +1,26 @@ name: Build and Push Docker Images + on: push: tags: - "backend*" + - "frontend*" env: REGISTRY: ghcr.io BACKEND_IMAGE_NAME: ${{ github.repository_owner }}/study-app-api + FRONTEND_IMAGE_NAME: ${{ github.repository_owner }}/study-app-web + jobs: build-and-push-backend: name: Build and Push Backend runs-on: ubuntu-latest # Only run for backend tags if: contains(github.ref, 'backend') + permissions: contents: read packages: write + steps: - name: Checkout repository uses: actions/checkout@v4 @@ -41,3 +47,40 @@ jobs: outputs: tag: ${{ steps.tag.outputs.TAG }} app: backend + + build-and-push-frontend: + name: Build and Push Frontend + runs-on: ubuntu-latest + # Only run for frontend tags + if: contains(github.ref, 'frontend') + + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract tag name + id: tag + run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT + + - name: Build and push frontend Docker image + uses: docker/build-push-action@v5 + with: + context: ./src/frontend + push: true + tags: | + ${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE_NAME }}:${{ steps.tag.outputs.TAG }} + ${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE_NAME }}:latest + outputs: + tag: ${{ steps.tag.outputs.TAG }} + app: frontend From 9cda76fc2f778387fcd07478699e494b179501b0 Mon Sep 17 00:00:00 2001 From: aadil96 Date: Thu, 20 Nov 2025 14:39:28 +0000 Subject: [PATCH 4/5] fix(frontend): correct component type for frontend in release-please config --- release-please-config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release-please-config.json b/release-please-config.json index c860317..dfd5d54 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -17,7 +17,7 @@ "src/frontend": { "release-type": "python", "package-name": "study-tracker-frontend", - "component": "backend", + "component": "frontend", "include-component-in-tag": true, "changelog-path": "CHANGELOG.md", "extra-files": [ @@ -29,4 +29,4 @@ ] } } -} +} \ No newline at end of file From cdfa2e07c83bc67f15c0b36636934920ceb6b71e Mon Sep 17 00:00:00 2001 From: aadil96 Date: Thu, 20 Nov 2025 14:40:47 +0000 Subject: [PATCH 5/5] refactor(frontend): remove redundant comment for helper functions in main.py --- src/frontend/src/frontend/main.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/frontend/src/frontend/main.py b/src/frontend/src/frontend/main.py index 9d1382c..3719fb5 100644 --- a/src/frontend/src/frontend/main.py +++ b/src/frontend/src/frontend/main.py @@ -30,7 +30,6 @@ def format_session(session: Dict[str, Any]) -> Dict[str, Any]: return session -# Helper functions for API calls # Helper functions for API calls def get_sessions() -> List[Dict[str, Any]]: """Get all study sessions from the API"""