Generate Gource Visualization #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 Gource Visualization | |
on: | |
# push: | |
# branches: | |
# - main | |
workflow_dispatch: | |
jobs: | |
gource-visualization: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Gource and dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y gource ffmpeg xvfb | |
- name: Start Xvfb (virtual display) | |
run: | | |
Xvfb :99 -screen 0 1920x1080x24 & | |
export DISPLAY=:99 | |
- name: Generate Gource Visualization | |
run: | | |
# Variables | |
title='${{ github.event.repository.name }}' | |
output_file_name='./output-visualization' | |
frame_rate=60 | |
# Run Gource with Xvfb (virtual display) | |
gource -r $frame_rate --multi-sampling --key --title "$title" --seconds-per-day .1 -1920x1080 -o ${output_file_name}.ppm | |
# Convert the output to MP4 using FFmpeg | |
ffmpeg -r $frame_rate -f image2pipe -vcodec ppm -i ${output_file_name}.ppm -c:v libx264 -pix_fmt yuv420p -profile:v baseline -level 3.0 -crf 4 -preset veryslow -an -movflags +faststart -threads 0 ${output_file_name}.mp4 | |
- name: Upload Visualization | |
uses: actions/upload-artifact@v4 | |
with: | |
name: gource-visualization | |
path: ./output-visualization.mp4 |