Skip to content

feat(Header): add theme switcher button with dark/light/auto modes #6

feat(Header): add theme switcher button with dark/light/auto modes

feat(Header): add theme switcher button with dark/light/auto modes #6

name: Publish Docker images to GitHub Packages
on:
push:
branches: [main]
paths:
- "apps/backend/**"
- "apps/frontend/**"
- ".github/workflows/github-package.yml"
workflow_dispatch:
env:
REGISTRY: ghcr.io
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- name: backend
dockerfile: apps/backend/Dockerfile
image: repohub-backend
- name: frontend
dockerfile: apps/frontend/Dockerfile
image: repohub-frontend
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Normalize repository owner
id: owner
shell: bash
run: echo "value=${GITHUB_REPOSITORY_OWNER,,}" >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ steps.owner.outputs.value }}/${{ matrix.image }}
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=sha
type=ref,event=branch
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max