Skip to content

Refactor code structure for improved readability and maintainability #25

Refactor code structure for improved readability and maintainability

Refactor code structure for improved readability and maintainability #25

Workflow file for this run

name: Docker Image CI
on:
push:
tags:
- "v*.*.*"
jobs:
build:
runs-on: ubuntu-latest
steps:
# 1️⃣ Checkout code
- name: Checkout Repository
uses: actions/checkout@v4
# 2️⃣ Login to DockerHub
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# 3️⃣ Setup Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# 4️⃣ Extract tag version
- name: Extract version
id: version
run: |
VERSION=${GITHUB_REF#refs/tags/}
echo "version=$VERSION" >> $GITHUB_OUTPUT
# 5️⃣ Build & Push
- name: Build & Push Docker Image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/streamvision:${{ steps.version.outputs.version }}
${{ secrets.DOCKERHUB_USERNAME }}/streamvision:latest
cache-from: type=gha
cache-to: type=gha,mode=max