Skip to content

Commit

Permalink
Backport: Add action to build and deploy site-docs automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
laeubi authored and Christoph Läubrich committed Oct 10, 2022
1 parent 27bd80f commit 3cdc8e7
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/sitedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
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
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 Bot"
git config user.email "<>"
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

0 comments on commit 3cdc8e7

Please sign in to comment.