Skip to content

Sync main documentation #1312

Sync main documentation

Sync main documentation #1312

Workflow file for this run

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 }}