Skip to content

Sync main documentation #1928

Sync main documentation

Sync main documentation #1928

Workflow file for this run

name: Sync main documentation
on:
schedule:
- cron: '0 1 * * *'
workflow_dispatch:
permissions:
packages: read
jobs:
sync:
runs-on: ubuntu-latest
if: github.repository == 'quarkusio/quarkusio.github.io'
environment: quarkus-push-website
steps:
- name: Generate GitHub App token
id: generate-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.QUARKUS_PUSH_WEBSITE_APP_ID }}
private-key: ${{ secrets.QUARKUS_PUSH_WEBSITE_PRIVATE_KEY }}
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: main
token: ${{ steps.generate-token.outputs.token }}
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: quarkusio/quarkus
path: .quarkus-main-repository
- name: Install JDK 17
uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0
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@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
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 "action@github.com"
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
uses: quarkusio/report-status-in-issue@main
if: always() && github.repository == 'quarkusio/quarkusio.github.io'
with:
github-token: ${{ secrets.SYNC_MAIN_TOKEN }}
status: ${{ job.status }}
issue-repository: quarkusio/quarkus
issue-number: 17071