Skip to content

remove print

remove print #74

name: Build and Push
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
REGISTRY: ghcr.io
ORG_NAME: scottylabs
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
service:
- name: backend
context: ./backend
image: quest-backend-production
- name: frontend
context: ./frontend
image: quest-frontend-production
- name: qr-code-gen
context: ./qr-code-gen
image: quest-qr-code-gen-production
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.ORG_NAME }}/${{ matrix.service.image }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha,prefix={{branch}}-
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ${{ matrix.service.context }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
${{ matrix.service.name == 'qr-code-gen' && format('VITE_DATA_BASE64={0}', secrets.VITE_DATA_BASE64) || '' }}