Skip to content

Workflow file for this run

name: Deploy to GitHub Container Registry
on:
release:
types: [created]
env:
REGISTRY: ghcr.io
CLIENT_IMAGE_NAME: ${{ github.repository }}-client
SERVER_IMAGE_NAME: ${{ github.repository }}-server
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
app: [client, server]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker image
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}-${{ matrix.app }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: ./${{ matrix.app }}
file: ./${{ matrix.app }}/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}