-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (44 loc) · 1.74 KB
/
publish-site.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
name: Build and publish Maven site
on:
push:
branches: [ main ]
jobs:
site:
runs-on: ubuntu-latest
env:
# WebFX requires at least JDK 13 due to javac bugs in prior versions (otherwise JDK 11+ should be enough in theory)
jdk-version: '19'
repo-dir: .
target-site-dir: './target/staging/webfx-platform'
web-push-repository-name: 'webfx-netlify'
web-push-repository-owner: 'webfx-project'
web-push-branch: 'site-platform'
web-push-username: ${{ github.actor }}
web-push-email: ${{ secrets.API_GITHUB_EMAIL }}
web-site-url: 'https://site-platform.webfx.dev'
steps:
# Set up the JDK and Maven settings.xml
- name: Set up JDK ${{ env.jdk-version }}
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ env.jdk-version }}
# Checkout this repository
- name: Checkout this repository
uses: actions/checkout@v3
with:
path: ${{ env.repo-dir }}
# Build Maven site
- name: Build Maven site
run: mvn -B -Dplugin.site.param.topSiteURL=${{ env.web-site-url }} install site site:stage
- name: Publish Maven site to ${{ env.web-push-branch }} branch
uses: cpina/github-action-push-to-another-repository@master
env:
API_TOKEN_GITHUB: ${{ secrets.API_GITHUB_TOKEN }}
with:
source-directory: ${{ env.target-site-dir }}
destination-repository-username: ${{ env.web-push-repository-owner }}
destination-repository-name: ${{ env.web-push-repository-name }}
target-branch: ${{ env.web-push-branch }}
destination-github-username: ${{ env.web-push-username }}
user-email: ${{ env.web-push-email }}