Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/docker-build-push.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
3 changes: 2 additions & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"src/backend": "0.2.0"
"src/backend": "0.2.0",
"src/frontend": "0.0.0"
}
14 changes: 14 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
}
}
1 change: 1 addition & 0 deletions src/frontend/src/frontend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down