Skip to content
Merged
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
52 changes: 52 additions & 0 deletions .github/workflows/backend-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build and Push Backend Docker Image

on:
push:
branches: [ "main" ]
paths:
- "parental-control-system/backend/**"
- ".github/workflows/backend-docker.yml"
workflow_dispatch:

permissions:
contents: read
packages: write

env:
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/parental-control-backend

jobs:
docker:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Comment thread
echska marked this conversation as resolved.

- name: Log in to GHCR
uses: docker/login-action@v3
Comment thread
echska marked this conversation as resolved.
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=sha
type=raw,value=latest
Comment thread
echska marked this conversation as resolved.
Comment thread
echska marked this conversation as resolved.

- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./parental-control-system/backend
file: ./parental-control-system/backend/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Loading