-
Notifications
You must be signed in to change notification settings - Fork 84
46 lines (39 loc) · 1.29 KB
/
schedule-add-daily-article.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
name: Add Daily Article Scheduled
on:
schedule:
- cron: "21 5 1-25 12 *" # every 5:21 AM UTC 1st-25th December
jobs:
add-article:
name: Add today's article without a PR
permissions:
pull-requests: write # for repo-sync/pull-request to create a PR
contents: write # for repo-sync/pull-request to create a PR
runs-on: ubuntu-latest
steps:
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
with:
ref: website
submodules: true
- uses: coursier/cache-action@v6
- uses: VirtusLab/[email protected]
with:
jvm: "temurin:17"
apps: sbt
- name: Generate todays article
run: scala-cli run .github/workflows/scripts/addDay.scala
- name: Push article to website branch
run: |
git config user.name gh-actions
git config user.email [email protected]
git add .
if ! git diff-index --quiet HEAD; then
git commit -m "Add article of ${{ steps.date.outputs.date }}"
git push -f
fi
- name: Publish ${{ github.ref }}
run: sbt docs/docusaurusPublishGhpages
env:
GITHUB_DEPLOY_KEY: ${{ secrets.DOC }}