-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (33 loc) · 1.14 KB
/
Copy pathdocs.yml
File metadata and controls
33 lines (33 loc) · 1.14 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
name: Docs Sync
on:
schedule:
- cron: '27 4 * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Update notes
run: |
TODAY=$(TZ='Asia/Kolkata' date '+%Y-%m-%d')
TOPICS=("AWS S3 lifecycle" "Docker networking" "Kubernetes pods" "Linux permissions" "Nginx" "Git workflows")
TOPIC=${TOPICS[$((RANDOM % ${#TOPICS[@]}))]}
mkdir -p notes docs
echo "# $TODAY" > notes/${TODAY}.md
echo "Topic: $TOPIC" >> notes/${TODAY}.md
echo "Revised $TOPIC" >> notes/${TODAY}.md
echo "- $TODAY: $TOPIC" >> docs/learning-index.md
- name: Commit
run: |
git config user.name "mohit-tanwar-dev"
git config user.email "mohitsingtanwar000@gmail.com"
TODAY=$(TZ='Asia/Kolkata' date '+%Y-%m-%d')
git add .
git diff --staged --quiet && exit 0
MSGS=("docs: update notes $TODAY" "Add learning notes $TODAY" "docs: daily update")
MSG=${MSGS[$((RANDOM % ${#MSGS[@]}))]}
git commit -m "$MSG"
git push