45 lines
1.2 KiB
YAML
45 lines
1.2 KiB
YAML
name: Build and Publish Images
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to GHCR
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and push backend image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: ./backend
|
|
push: true
|
|
tags: |
|
|
ghcr.io/${{ github.repository_owner }}/family_budget-backend:latest
|
|
ghcr.io/${{ github.repository_owner }}/family_budget-backend:${{ github.sha }}
|
|
|
|
- name: Build and push frontend image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: ./frontend
|
|
push: true
|
|
tags: |
|
|
ghcr.io/${{ github.repository_owner }}/family_budget-frontend:latest
|
|
ghcr.io/${{ github.repository_owner }}/family_budget-frontend:${{ github.sha }}
|