Skip to content

Update requirements #25

Update requirements

Update requirements #25

name: Build and publish Docker image
on:
workflow_dispatch:
push:
branches: [main]
paths:
- "src/**"
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-publish-alpine:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v3
- name: Login to container registry πŸ”
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata 🏷️
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: πŸ”¨ Build and Publish alpine πŸš€
uses: docker/build-push-action@v3
with:
context: src
push: true
tags: ${{ env.REGISTRY }}/cc-youcube/youcube:latest,${{ env.REGISTRY }}/cc-youcube/youcube:alpine
labels: ${{ steps.meta.outputs.labels }}
build-and-publish-nvidia:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v3
- name: Login to container registry πŸ”
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata 🏷️
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: πŸ”¨ Build and Publish nvidia πŸš€
uses: docker/build-push-action@v3
with:
file: src/Dockerfile.nvidia
context: src
push: true
tags: ${{ env.REGISTRY }}/cc-youcube/youcube:ubuntu-nvidia
labels: ${{ steps.meta.outputs.labels }}