Sync main documentation #231
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sync main documentation | |
on: | |
schedule: | |
- cron: '0 1 * * *' | |
workflow_dispatch: | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: develop | |
- uses: actions/checkout@v3 | |
with: | |
repository: quarkusio/quarkus | |
path: .quarkus-main-repository | |
- name: Install JDK 17 | |
uses: actions/setup-java@v3 | |
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@v3 | |
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 develop --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 develop --rebase | |
- name: Push changes to develop | |
# Uses sha for added security since tags can be updated | |
uses: ad-m/github-push-action@057a6ba835d986bfe495dd476a6c4db1d5f9503c | |
with: | |
github_token: ${{ secrets.SYNC_MAIN_TOKEN }} | |
branch: develop | |
- 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 }} |