-
Notifications
You must be signed in to change notification settings - Fork 5
54 lines (45 loc) · 1.32 KB
/
xmls_gen_cron_job.yml
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Daily XML Generation Script
on:
schedule:
- cron: "0 1 * * *" # every day at 01:00 AM UTC
workflow_dispatch:
repository_dispatch:
permissions:
contents: write
jobs:
execute_and_commit:
runs-on: ubuntu-latest
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ES_CLOUD_ID: ${{ secrets.ES_CLOUD_ID }}
ES_USERNAME: ${{ secrets.ES_USERNAME }}
ES_PASSWORD: ${{ secrets.ES_PASSWORD }}
ES_INDEX: ${{ secrets.ES_INDEX }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.10.x
- name: Install dependencies
run: |
pip install --upgrade pip setuptools
pip install -r requirements.txt
- name: Execute Python script
run: python xmls_generator_production.py
- name: Configure Git
run: |
git config user.email "${{ secrets.GIT_AUTHOR_EMAIL }}"
git config user.name "${{ secrets.GIT_AUTHOR_NAME }}"
- name: Add and commit changes
run: |
git add .
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "Updated newly generated xml files"
git push
fi