forked from codinasion/codinasion
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (74 loc) · 2.33 KB
/
collect-program-data.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Collect Program Data
on:
workflow_dispatch:
schedule:
- cron: "0 0/6 * * *"
jobs:
collect_program_data:
if: github.repository == 'codinasion/program'
runs-on: ubuntu-latest
name: Collect Program Data
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.REPO_TOKEN }}
########## Get Date ##########
- name: Get Date
id: date
uses: nanzm/[email protected]
with:
timeZone: 5.5
format: "YYYY-MM-DD-hh-mm"
# Cache node_modules
- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v2
with:
path: node_modules
key: node-modules-${{ hashFiles('yarn.lock') }}
# Install dependencies
- name: Yarn
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: |
yarn
########## Rename program files ##########
- name: Rename Program Files
run: |
python3 scripts/rename_files.py
- name: Move Program Files
run: |
mkdir -p temp
mv program/ temp/
- name: Commit Rename Program Files
uses: crazy-max/[email protected]
with:
target_branch: master
build_dir: temp
keep_history: true # <-- Don't touch it
committer: Harsh Raj <[email protected]>
author: Harsh Raj <[email protected]>
commit_message: |
rename program files
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
########## collect program data ##########
- name: Collect Program Data
uses: ./action/
with:
COLLECT_PROGRAM_DATA: true
TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit Program Data
uses: crazy-max/[email protected]
with:
target_branch: data
build_dir: program-data
keep_history: false
committer: Harsh Raj <[email protected]>
author: Harsh Raj <[email protected]>
commit_message: |
program list data - ${{ steps.date.outputs.time }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}