From 82f459c87cf3f09be72c397f098ea932576c56f3 Mon Sep 17 00:00:00 2001 From: "Jun Siang Cheah (aider)" Date: Sun, 1 Sep 2024 22:51:43 +0100 Subject: [PATCH] ci: Add GitHub Actions workflow to update README with latest models --- .github/workflows/update-readme.yml | 42 +++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/update-readme.yml diff --git a/.github/workflows/update-readme.yml b/.github/workflows/update-readme.yml new file mode 100644 index 0000000..b6cc8f6 --- /dev/null +++ b/.github/workflows/update-readme.yml @@ -0,0 +1,42 @@ +name: Update README + +on: + schedule: + - cron: "0 0 * * *" + workflow_dispatch: + +jobs: + update-readme: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Install dependencies + run: | + pip install -r src/requirements.txt + - name: Set environment variables + run: | + echo "GROQ_API_KEY=${{ secrets.GROQ_API_KEY }}" >> .env + echo "CLOUDFLARE_ACCOUNT_ID=${{ secrets.CLOUDFLARE_ACCOUNT_ID }}" >> .env + echo "CLOUDFLARE_API_KEY=${{ secrets.CLOUDFLARE_API_KEY }}" >> .env + echo "HYPERBOLIC_API_KEY=${{ secrets.HYPERBOLIC_API_KEY }}" >> .env + echo "GCP_PROJECT_ID=${{ secrets.GCP_PROJECT_ID }}" >> .env + - name: Run script + run: | + python src/pull_available_models.py + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "Update README with latest models" + branch: update-readme + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + title: "Update README with latest models" + body: "This PR updates the README with the latest available models." + branch: update-readme + base: main