Publish #1080
This file contains hidden or 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
| # This workflow will build a Java project with Maven | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
| name: Publish | |
| on: | |
| push: | |
| branches: [ main ] | |
| schedule: | |
| - cron: '0 5 * * *' | |
| workflow_dispatch: | |
| concurrency: | |
| # Only run once for latest commit per ref and cancel other (previous) runs. | |
| group: ${{ github.workflow }}-website | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| concurrency: publish-to-website | |
| if: github.repository == 'keycloak/keycloak-web' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/[email protected] | |
| - name: Set up JDK | |
| uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| cache: maven | |
| - name: Build with Maven | |
| env: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| run: ./mvnw -U -B -s mvn-rel-settings.xml package -Dpublish | |
| - name: Publish website contents as a release | |
| # This way it can be consumed in a simple way in the keycloak.github.io repository | |
| env: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| # language=bash | |
| run: | | |
| if ( gh release view website-contents &> /dev/null ); then | |
| echo 'release exists' | |
| else | |
| gh release create website-contents --title "Website contents" --draft | |
| fi | |
| tar -cvzf contents.tar.gz -C target/web . | |
| gh release upload website-contents contents.tar.gz --clobber | |
| gh release edit website-contents --draft=false | |
| - name: Install SSH Client 🔑 | |
| uses: webfactory/[email protected] | |
| with: | |
| ssh-private-key: ${{ secrets.DEPLOY_KEY }} | |
| - name: Deploy 🚀 | |
| uses: JamesIves/[email protected] | |
| with: | |
| SSH: true | |
| REPOSITORY_NAME: keycloak/keycloak.github.io | |
| BRANCH: main | |
| FOLDER: target/web | |
| CLEAN: true | |
| CLEAN_EXCLUDE: '["docs", "docs-api"]' |