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
@@ -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
1 change: 1 addition & 0 deletions src/backend/src/backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down