Generate Video #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate Video | |
on: | |
workflow_dispatch: | |
inputs: | |
scriptInput: | |
description: 'Text script input (required)' | |
required: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Install essential packages | |
- name: Install essential packages | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential | |
sudo apt-get install -y cmake | |
sudo apt-get install -y make | |
sudo apt-get install -y g++ | |
sudo apt-get install -y ffmpeg | |
sudo apt-get install -y libmagick++-dev | |
# Checkout repository recursively | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
# Change directory to whisper submodule and build it | |
- name: Build whisper submodule | |
run: | | |
cd lib/whisper | |
cmake -B build | |
cmake --build build | |
# Move the main binary to the root of the project | |
- name: Move main binary to project root | |
run: | | |
mv lib/whisper/build/bin/main . | |
# Run model downloader script | |
- name: Run model downloader script | |
run: | | |
./models/downloader.sh large-v1 | |
# Set up Python and install Python dependencies | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' # You can specify a specific Python version here | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install moviepy pytube gtts | |
# Make the generate-with-extra-logging.sh script executable | |
- name: Make script executable | |
run: chmod +x generate-with-extra-logging.sh | |
# Generate the video using the provided text script | |
- name: Generate Video | |
run: | | |
# Accessing the input provided by the user | |
script="${{ github.event.inputs.scriptInput }}" | |
# Run the generate-with-extra-logging.sh script with the provided text as argument | |
./generate-with-extra-logging.sh "$script" | |
# Upload the generated video as an artifact | |
- name: Upload Video Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: final_video_with_audio | |
path: final_video_with_audio.mp4 |