This repository has been archived by the owner on Jul 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 167
65 lines (56 loc) · 1.87 KB
/
collect-blog-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
name: Collect Blog Data
on:
schedule:
- cron: "17 0 * * *"
workflow_dispatch:
inputs:
TEST:
description: "This is a test ?"
required: true
type: boolean
default: false
RUNNER:
type: choice
description: "Action Runner"
default: "self-hosted"
required: true
options:
- "ubuntu-latest"
- "self-hosted"
jobs:
collect-blog-data:
name: Collect Blog Data
runs-on: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.RUNNER == 'ubuntu-latest' && 'ubuntu-latest' || 'self-hosted' }}
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Collect Blog Data
id: collect-blog-data
uses: ./action/
with:
TEST: ${{ inputs.TEST || 'false' }}
# Trigger
TRIGGER_COLLECT_BLOG_DATA: true
# Secrets
GITHUB_TOKEN: ${{ secrets.CODINASION_GITHUB_TOKEN }}
- name: Get Time
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.TEST == 'false')
id: time
uses: nanzm/get-time-action@master
with:
timeZone: UTC+5.5
format: "YYYY-MM-DD-HH-mm-ss"
- name: Commit Blog Data
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.TEST == 'false')
uses: crazy-max/ghaction-github-pages@v3.0.0
with:
target_branch: "blog-data"
build_dir: blog-data
keep_history: false
committer: Harsh Raj <harshraj8843@users.noreply.github.com>
author: Harsh Raj <harshraj8843@users.noreply.github.com>
commit_message: |
Collect Blog Data - ${{ steps.time.outputs.time }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}