Skip to content

Instantly share code, notes, and snippets.

@mjbear
Created October 2, 2024 03:11
Show Gist options
  • Save mjbear/1d2eeb33f5d07c2ce904210335a80302 to your computer and use it in GitHub Desktop.
Save mjbear/1d2eeb33f5d07c2ce904210335a80302 to your computer and use it in GitHub Desktop.
# Credit: https://github.com/planetoftheweb/podcast-generator/pull/2
FROM ubuntu:latest
RUN apt-get update && \
apt-get install -y \
python3.10 \
python3-pip \
python3-venv \
git
# me: Could also simply use apt-get to install python3-yaml and skip the virtual env altogether
# Create a virtual environment
RUN python3 -m venv /venv
# Install PyYAML within the virtual environment
RUN /venv/bin/pip install PyYAML
COPY feed.py /usr/bin/feed.py
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
#!/bin/bash
# Credit: https://github.com/planetoftheweb/podcast-generator/pull/3
echo "==================="
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${INPUT_EMAIL}"
git config --global --add safe.directory /github/workspace
# Run your Python script using the Python interpreter from the virtual environment
/venv/bin/python /usr/bin/feed.py
git add -A && git commit -m "Update Feed"
git push --set-upstream origin main
echo "==================="
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment