Skip to content

Commit 81c6ef7

Browse files
committed
Add workflow code to update the website
1 parent 49e7382 commit 81c6ef7

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

.github/workflows/main.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: Create a new release in the GitHub repository if needed
1212
runs-on: ubuntu-latest
1313
steps:
14-
- name: Checkout the code
14+
- name: Checkout the main branch
1515
uses: actions/checkout@v2
1616

1717
# Refer to https://stackoverflow.com/a/69116750 for running Kotlin scripts
@@ -54,9 +54,28 @@ jobs:
5454
run: kotlin set-rss-last-update.main.kts
5555

5656
# Also see https://github.com/EndBug/add-and-commit
57-
- name: Commit the changes
57+
- name: Commit main changes
5858
uses: stefanzweifel/git-auto-commit-action@v4
5959
if: ${{ steps.check-for-updates.outputs.result == 'stale' }}
6060
with:
6161
commit_message: Update last RSS update time
6262
file_pattern: last-rss-update.txt
63+
64+
# See https://github.community/t/how-to-commit-to-two-branches-from-an-action/17713
65+
- name: Checkout the website branch
66+
uses: actions/checkout@v2
67+
with:
68+
ref: website
69+
clean: 'false'
70+
71+
- name: Update website content
72+
if: ${{ steps.check-for-updates.outputs.result == 'stale' }}
73+
run: kotlin update-website-content.main.kts
74+
75+
- name: Commit website changes
76+
uses: stefanzweifel/git-auto-commit-action@v4
77+
if: ${{ steps.check-for-updates.outputs.result == 'stale' }}
78+
with:
79+
branch: website
80+
commit_message: Update website content
81+
file_pattern: docs/*

0 commit comments

Comments
 (0)