-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (32 loc) · 1.1 KB
/
main.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
name: Nightly Site Regeneration
on:
schedule:
# Runs at midnight UTC
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Environment Variables
run: echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> $GITHUB_ENV
- name: Test
run: |
ls -l
date > date.txt
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add date.txt
git commit -m "Update date"
git push --set-upstream https://${GITHUB_TOKEN}@github.com/dfeldman/quackernews.git main
- name: Run Script to Generate Content
run: bash scripts/script.sh
- name: Commit and Push Changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -A
git commit -m "Regenerate site" || echo "No changes to commit."
git push --set-upstream https://${GITHUB_TOKEN}@github.com/dfeldman/quackernews.git main