forked from sunithvs/devb.io
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (37 loc) · 1.28 KB
/
consumer.yml
File metadata and controls
37 lines (37 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Consumer
on:
workflow_dispatch: # This allows you to manually trigger the workflow from the Actions tab.
permissions:
contents: write # Ensure the workflow has write access to contents
jobs:
fetch-data:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4 # Updated to v4 for latest features
with:
fetch-depth: 0 # Fetch all history for all branches
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Profile generation
run: |
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
git checkout -b data --track origin/data || git checkout data
python manage.py fetch
python manage.py build
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
- name: Commit and push changes if there are any
run: |
git config --global user.name 'devb'
git config --global user.email 'git@devb.io'
git add docs/*
git add data/*
git diff --quiet && git diff --staged --quiet || (git commit -m "Update data" && git push origin data)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}