Daily Publication #129
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: Daily Publication | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 3 * * *' | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: main | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install Dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install ffmpeg libavcodec-extra xvfb | |
python -m pip install --upgrade pip | |
pip install -e . | |
- uses: actions/checkout@v4 | |
with: | |
ref: 'gh-pages' | |
path: 'gh-pages' | |
- name: Run Routine | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
GOOGLE_SEARCH_CSE_ID: ${{ secrets.GOOGLE_SEARCH_CSE_ID }} | |
GOOGLE_SEARCH_API_KEY: ${{ secrets.GOOGLE_SEARCH_API_KEY }} | |
run: run_routine --archive "$(pwd)/gh-pages/embeddings" -l DEBUG | |
- name: Commit Changes to gh-pages Branch | |
run: | | |
cp -r results/*.md gh-pages/_posts/ | |
cp -r results/*.mp3 gh-pages/audio/ | |
cp -r results/*.csv gh-pages/embeddings/ | |
cd gh-pages | |
git config --global user.name ${{ secrets.USERNAME }} | |
git config --global user.email ${{ secrets.EMAIL_ADDRESS }} | |
git add . | |
CURRENT_TIME=$(date +'%Y-%m-%d %H:%M:%S') | |
git commit -m "Automated publication: $CURRENT_TIME" || echo "No changes to commit" | |
git push origin gh-pages |