Skip to content

Bump jvm from 2.0.21 to 2.1.0 #338

Bump jvm from 2.0.21 to 2.1.0

Bump jvm from 2.0.21 to 2.1.0 #338

name: Kotlin CI with Gradle, Build & Push OCI Image
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
REGISTRY: ghcr.io/${{ github.repository_owner }}
IMAGE_NAME: graphql-reactive
jobs:
build-gradle:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '17'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: always()
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
build-push-image:
name: Build OCI Image and push to GitHub Packages
runs-on: ubuntu-latest
needs: build-gradle
if: contains('refs/heads/main', github.ref)
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Check out code
uses: actions/checkout@v4
- name: Set Branch name
id: branch-name
run: |
# Short name for current branch. For PRs, use target branch (base ref)
GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
- name: Set Image Tags
id: image-tags
run: |
echo ::set-output name=branch_commit_tag::${GIT_BRANCH}-${COMMIT}
echo ::set-output name=branch_tag::${GIT_BRANCH}-latest
env:
COMMIT: ${{ github.sha }}
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '17'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build OCI with Gradle
run: ./gradlew bootBuildImage
env:
IMAGE_TAG_BRANCH_COMMIT: ${{ steps.image-tags.outputs.branch_commit_tag }}
IMAGE_TAG_BRANCH: ${{ steps.image-tags.outputs.branch_tag }}
# https://github.com/paketo-buildpacks/ca-certificates#configuration
BP_EMBED_CERTS: true
BP_RUNTIME_CERT_BINDING_DISABLED: true
BP_ENABLE_RUNTIME_CERT_BINDING: false
- name: Push OCI to GitHub Packages
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
docker push $REGISTRY/$IMAGE_NAME --all-tags
build-push-image-dry-run:
name: Build OCI Image (Dry Run)
runs-on: ubuntu-latest
needs: build-gradle
if: github.event_name == 'pull_request'
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set Branch name
id: branch-name
run: |
# Short name for current branch. For PRs, use target branch (base ref)
GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
- name: Set Image Tags
id: image-tags
run: |
echo ::set-output name=branch_commit_tag::${GIT_BRANCH}-${COMMIT}
echo ::set-output name=branch_tag::${GIT_BRANCH}-latest
env:
COMMIT: ${{ github.sha }}
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '17'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build OCI with Gradle
run: ./gradlew bootBuildImage
env:
IMAGE_TAG_BRANCH_COMMIT: ${{ steps.image-tags.outputs.branch_commit_tag }}
IMAGE_TAG_BRANCH: ${{ steps.image-tags.outputs.branch_tag }}
# https://github.com/paketo-buildpacks/ca-certificates#configuration
BP_EMBED_CERTS: true
BP_RUNTIME_CERT_BINDING_DISABLED: true
BP_ENABLE_RUNTIME_CERT_BINDING: false
- name: Push OCI to GitHub Packages (Dry Run)
run: |
echo docker push $REGISTRY/$IMAGE_NAME --all-tags