Skip to content

Fix gh-pages deployment on CI #56

Fix gh-pages deployment on CI

Fix gh-pages deployment on CI #56

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
# Always test on the latest version and all LTS.
java: [ 11, 17, 21, 22 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- uses: gradle/actions/setup-gradle@v4
- run: ./gradlew build
publish-snapshot:
needs: build
runs-on: ubuntu-latest
if: github.repository == 'GradleUp/shadow' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
- uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true
# Disable CC due to https://github.com/gradle/gradle/issues/22779
- run: ./gradlew publish --no-configuration-cache
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USER }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
deploy-pages:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
- uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true
- uses: actions/setup-node@v4
with:
# Due to some limitations of https://github.com/node-gradle/gradle-node-plugin.
node-version: '16'
- run: ./gradlew gitPublishPush --no-configuration-cache
env:
# https://ajoberstar.org/grgit/main/grgit-authentication.html#_environment_variables
GRGIT_USER: ${{ github.repository_owner }}
GRGIT_PASS: ${{ secrets.GITHUB_TOKEN }}