forked from eclipse-tycho/tycho
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (65 loc) · 1.98 KB
/
sitedocs.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: Publish Tycho site-docs
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- 'master'
- 'tycho-*'
jobs:
build:
name: Publish site-docs
runs-on: ubuntu-latest
strategy:
fail-fast: false
permissions:
contents: write
repository-projects: write
steps:
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
- name: Checkout tycho code
uses: actions/checkout@v3
with:
path: 'tycho'
- name: Checkout page
uses: actions/checkout@v3
with:
path: 'page'
repository: 'eclipse-tycho/eclipse-tycho.github.io'
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'adopt'
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-site-${{ hashFiles('**/pom.xml', '**/*.target') }}
restore-keys: |
${{ runner.os }}-maven-site-
- name: Set up Maven
uses: stCarolas/[email protected]
with:
maven-version: 3.8.6
- name: Build site-doc
env:
JAVA_HOME: ${{ env.JAVA_HOME_17_X64 }}
run: |
mvn -U -V -e -B -ntp clean install site site:stage --file tycho/pom.xml -T1C -DskipTests
- name: Upload site-doc
uses: actions/upload-artifact@v3
with:
name: site-docs-${{ env.GITHUB_REF_NAME }}
if-no-files-found: error
path: |
${{ github.workspace }}/tycho/target/staging/**/*.*
- run: |
cd ${{ github.workspace }}/page/doc/
git config user.name github-actions
git config user.email [email protected]
cp -r ${{ github.workspace }}/tycho/target/staging/ ${{ env.GITHUB_REF_NAME }}
git diff --quiet && git diff --staged --quiet || git commit -am "Update sitedocs for branch ${{ env.GITHUB_REF_NAME }}"
git push