-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (41 loc) · 1.29 KB
/
Copy pathrunscript.yml
File metadata and controls
49 lines (41 loc) · 1.29 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Fetch Files
on:
push:
paths:
- 'post/**'
workflow_dispatch: # 수동으로도 실행 가능
jobs:
fetch_and_trigger:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install Node.js dependencies
run: npm install
- name: Fetch GitHub file list
run: node fetch_files.js
- name: Commit and push changes
run: |
git config --local user.name "GitHub Actions"
git config --local user.email "actions@github.com"
git restore package-lock.json
git add post_files.json
git commit -m "Update post_files.json with the latest post data"
git push
env:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Trigger Build Workflow
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const dispatch = await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: "deploy.yml",
ref: "main",
});