-
Notifications
You must be signed in to change notification settings - Fork 612
65 lines (54 loc) · 1.85 KB
/
sync_docs.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
name: Synchronize changes to the website
on:
push:
branches:
- 'main'
- '14.0.x'
paths:
- 'documentation/**'
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Maven
uses: s4u/setup-maven-action@v1.13.0
with:
java-version: 17
maven-version: 3.9.0
- name: Build docs with Maven
run: mvn install -Pdistribution -pl documentation -am -s maven-settings.xml
- name: Clone infinispan.github.io
uses: actions/checkout@master
with:
repository: infinispan/infinispan.github.io
ref: master
path: infinispan.github.io
- if: github.ref == 'refs/heads/main'
name: Copy docs to dev
run: |
cp -r documentation/target/generated/1*/html/* infinispan.github.io/docs/dev/
- if: github.ref == 'refs/heads/14.0.x'
name: Copy docs to stable
run: |
cp -r documentation/target/generated/1*/html/* infinispan.github.io/docs/stable/
- name: Commit files
run: |
cd infinispan.github.io
git config -l | grep 'http\..*\.extraheader' | cut -d= -f1 | xargs -L1 git config --unset-all
git config --global user.email "infinispan@infinispan.org"
git config --global user.name "Infinispan"
git add . --all
git commit -m "Synchronized core docs from ${{ github.ref }}"
- name: Push to the community site
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source-directory: 'infinispan.github.io'
destination-github-username: 'infinispan'
destination-repository-name: 'infinispan.github.io'
user-email: infinispan@infinispan.org
target-branch: master