Skip to content

Whole code (check riccardo0731/ChatBot for original root - this is my… #1

Whole code (check riccardo0731/ChatBot for original root - this is my…

Whole code (check riccardo0731/ChatBot for original root - this is my… #1

name: Docker Publish
on:
push:
branches: [ "main" ] # O 'master', controlla come si chiama il vostro branch
# Pubblica solo se vengono modificati file del server o utils
paths:
- 'server/**'
- 'utils.py'
- 'Dockerfile'
env:
REGISTRY: ghcr.io
IMAGE_NAME: gizano/multithreaded-python-chat
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
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
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}