Skip to content

Build and Publish Docker Image #1

Build and Publish Docker Image

Build and Publish Docker Image #1

Workflow file for this run

name: Build and Publish Docker Image
on:
push:
tags:
- "v*" # Триггер для версии, например, v1.0.0
workflow_dispatch: # Ручной запуск workflow
jobs:
build-and-push:
name: Build and Push Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract version from tag
id: extract_version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- name: Build and Push Docker Image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
your_dockerhub_username/youtube_node_downloader:${{ env.VERSION }}
your_dockerhub_username/youtube_node_downloader:latest