-
Notifications
You must be signed in to change notification settings - Fork 380
74 lines (68 loc) · 2.29 KB
/
sync-main-doc.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
66
67
68
69
70
71
72
73
74
name: Sync main documentation
on:
schedule:
- cron: '0 1 * * *'
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
if: github.repository == 'quarkusio/quarkusio.github.io'
steps:
- uses: actions/checkout@v4
with:
ref: main
- uses: actions/checkout@v4
with:
repository: quarkusio/quarkus
path: .quarkus-main-repository
- name: Install JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Get Date
id: get-date
run: |
echo "date=$(/bin/date -u "+%Y-%m")" >> $GITHUB_OUTPUT
shell: bash
- name: Cache Maven Repository
id: cache-maven
uses: actions/cache@v4
with:
path: ~/.m2/repository
# refresh cache every month to avoid unlimited growth
key: maven-repo-pr-${{ runner.os }}-${{ steps.get-date.outputs.date }}
- name: Build generated documentation
working-directory: .quarkus-main-repository
run: ./mvnw -B --settings .github/mvn-settings.xml -DquicklyDocs
- name: Rebase before rsync
run: |
git pull origin main --rebase
- name: Sync guides and generated documentation
run: |
.quarkus-main-repository/docs/sync-web-site.sh main ${PWD}
- name: Configure Git author
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Commit changes
shell: bash
run: |
git add .
if [ -n "$(git status --porcelain)" ]; then
git commit -am "Sync documentation of main branch"
fi
git pull origin main --rebase
git push origin main
- name: Report status
if: "always() && github.repository == 'quarkusio/quarkusio.github.io'"
shell: bash
run: |
curl -Ls https://sh.jbang.dev | bash -s - app setup
~/.jbang/bin/jbang .github/report-status-in-issue.java \
issueNumber=17071 \
runId=${{ github.run_id }} \
status=${{ job.status }} \
token=${{ secrets.SYNC_MAIN_TOKEN }} \
issueRepo=quarkusio/quarkus \
thisRepo=${{ github.repository }}