From c1bb560ab74f6ea1cbd48feef9c4c2cdc0d01450 Mon Sep 17 00:00:00 2001 From: Jeremy Landis Date: Sun, 19 Nov 2023 15:15:12 -0500 Subject: [PATCH] [GHA] Add 'site.yaml' to release the site To use, simply merge code up to either tip of master or to tag you which to have the site release on. --- .github/workflows/site.yaml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/site.yaml diff --git a/.github/workflows/site.yaml b/.github/workflows/site.yaml new file mode 100644 index 000000000..f3ca17bff --- /dev/null +++ b/.github/workflows/site.yaml @@ -0,0 +1,34 @@ +name: Site + +on: + push: + branches: + - site + +jobs: + build: + if: github.repository_owner == 'mybatis' && ! contains(toJSON(github.event.head_commit.message), '[maven-release-plugin]') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: 21 + distribution: zulu + - uses: webfactory/ssh-agent@master + with: + ssh-private-key: ${{ secrets.DEPLOY_KEY }} + - name: Build site + run: ./mvnw site site:stage -DskipTests -B -V --no-transfer-progress -Dlicense.skip=true + env: + CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Deploy Site to gh-pages + uses: JamesIves/github-pages-deploy-action@v4.4.3 + with: + ssh-key: true + branch: gh-pages + folder: target/staging + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}