Generates PPUD podcasts #371
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Generates PPUD podcasts | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ master ] | |
paths-ignore: | |
- '**/.gitignore' | |
- '**/*.md' | |
- LICENSE | |
- site/* | |
- vscode/* | |
pull_request: | |
branches: [ master ] | |
schedule: | |
- cron: "0 0 * * 1" #runs at 00:00 on Monday | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
if: "!contains(github.event.head_commit.message, 'AUTO')" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Fetch full Git history (not shallow) | |
run: | | |
git fetch --unshallow | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Create podcasts | |
run: | | |
python radio2podcasts/__main__.py --input=podcasts-ppud.json --output=index-ppud.html | |
if [[ -z $(git status -s) ]] | |
then | |
echo "Nothing to commit." | |
else | |
echo "---------------------------------" | |
ls | |
echo "---------------------------------" | |
git config user.name "catus felis" | |
git config user.email catusf@users.noreply.github.com | |
git branch --show-current | |
git add site | |
git status | |
git commit -m "AUTO - Update website" | |
git fetch | |
git push origin --force | |
fi | |
- name: Deploy site to GitHub Pages 🚀 | |
uses: JamesIves/github-pages-deploy-action@3.6.2 | |
with: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
BRANCH: gh-pages # The branch the action should deploy to. | |
FOLDER: site # The folder the action should deploy. | |
CLEAN: true # Automatically remove deleted files from the deploy branch |