Skip to content

Add homelab CI/CD configuration - Use GHCR images instead of local bu… #3

Add homelab CI/CD configuration - Use GHCR images instead of local bu…

Add homelab CI/CD configuration - Use GHCR images instead of local bu… #3

Workflow file for this run

name: Build & Push Portfolio Images
on:
push:
branches:
- main
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Log in to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build frontend image
run: |
docker build -t ghcr.io/${{ github.repository_owner }}/portfolio-frontend:latest ./frontend
- name: Build backend image
run: |
docker build -t ghcr.io/${{ github.repository_owner }}/portfolio-backend:latest ./backend
- name: Push frontend image
run: |
docker push ghcr.io/${{ github.repository_owner }}/portfolio-frontend:latest
- name: Push backend image
run: |
docker push ghcr.io/${{ github.repository_owner }}/portfolio-backend:latest