mirror of
https://github.com/ovosimpatico/SongQuiz.git
synced 2026-01-15 16:32:55 -03:00
45 lines
1.1 KiB
YAML
45 lines
1.1 KiB
YAML
name: Build and Push Docker Images
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and push backend image
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: ./backend
|
|
push: true
|
|
tags: ghcr.io/${{ github.repository_owner }}/songquiz-backend:latest
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
|
|
- name: Build and push frontend image
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: ./frontend
|
|
push: true
|
|
tags: ghcr.io/${{ github.repository_owner }}/songquiz-frontend:latest
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|