-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (42 loc) · 1.28 KB
/
update-content.yml
File metadata and controls
47 lines (42 loc) · 1.28 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
name: Update Content
on:
repository_dispatch:
types: [content-update]
workflow_dispatch:
inputs:
reason:
description: "Reason for content update"
required: false
jobs:
update-submodule:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.PORTFOLIO_PAT }}
- name: Update submodule to latest
run: |
cd content/portfolio
git checkout master
git pull origin master
cd ../..
- name: Commit and push if changed
run: |
git diff --exit-code content/portfolio && echo "No changes" && exit 0
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add content/portfolio
git commit -m "chore: update career-portfolio submodule"
git push
- name: Trigger deploy
uses: actions/github-script@v7
with:
script: |
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'deploy.yml',
ref: 'main',
});