Using Git LFS to version Podcast Audio files and trigger releases to production with GitHub Actions

This page summarizes the projects mentioned and recommended in the original post on dev.to

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • cloudwithchris.com

    Cloud With Chris is my personal blogging, podcasting and vlogging platform where I talk about all things cloud. I also invite guests to talk about their experiences with the cloud and hear about lessons learned along their journey.

  • name: "Podcast Audio Upload" on: push: branches: - master paths: - "podcast_audio/**" jobs: publish: environment: name: production.azure url: https://www.cloudwithchris.com runs-on: ubuntu-latest steps: - name: Download Podcast files that are different from prior commit run: | git clone --config lfs.fetchexclude="/podcast_audio" https://github.com/chrisreddington/cloudwithchris.com.git ./ fileschanged=$(git diff --name-only HEAD^ HEAD -- '*.mp3') echo "$fileschanged" > files.txt xargs -a files.txt -d'\n' rm git config --unset lfs.fetchexclude git checkout . cd podcast_audio sed -i -e 's/podcast_audio\///g' ../files.txt for i in *; do if ! grep -qxFe "$i" ../files.txt then echo "Deleting: $i" rm "$i" fi done - name: Azure Login uses: azure/login@v1 with: creds: ${{ secrets.AZURE_CREDENTIALS }} - name: "Upload podcast files to storage that don't yet exist" uses: azure/CLI@v1 with: azcliversion: 2.20.0 inlineScript: | az storage blob upload-batch --account-name cloudwithchrisprod -d 'podcasts' -s '/github/workspace/podcast_audio' --if-unmodified-since 2020-01-01T00:00Z --auth-mode login

  • billing

  • Chris, that looks to do the job. You're triggering the workflow run when there is a change in the podcast_audio folder pushed to the master branch. You've also enabled the lfs flag, so that the runner will go ahead and pull down the binary files as needed. Why is that a naïve implementation? I'm glad you asked! As a GitHub user you have a storage and bandwidth quota for Git LFS data. You can find this in the billing section of your GitHub account.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • checkout

    Action for checking out a repo

  • After digging into the checkout action from GitHub, it seemed that there weren't a set of properties that I could change to do exactly what I wanted. Fortunately, GitHub Actions allows you to use a set of composite run steps (a fancy way of saying run several steps from the command-line). I then broke the problem down into a series of steps, a bit like pseudocode.

  • git-lfs

    Git extension for versioning large files

  • Okay dear, user - how do you get set up with Git LFS? The Git LFS site I linked to above explains this really well, but I'll explain this in the context of my use case a little further. First off, I downloaded the extension shown on the Git LFS site and followed the appropriate installation steps (e.g. for windows there is an .exe file, for my Ubuntu WSL environment I had to add a new repository and use apt-get to download the binaries). Once installed, you can go ahead and run the command git lfs install. This is a one-time step that is needed for your local user account.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Git-annex: manage large files in Git without storing the contents in Git

    1 project | news.ycombinator.com | 16 Apr 2024
  • Twenty Years Is Nothing

    4 projects | news.ycombinator.com | 4 Mar 2024
  • Aho – a Git implementation in Awk

    8 projects | news.ycombinator.com | 10 Feb 2024
  • Ask HN: How do you keep your documentation, how-to, examples and blogs updated?

    1 project | news.ycombinator.com | 15 Dec 2023
  • We Put Half a Million Files in One Git Repository, Here's What We Learned (2022)

    4 projects | news.ycombinator.com | 28 Aug 2023