Skip to content

Update gradle.yml

Update gradle.yml #71

Workflow file for this run

name: Java CI with Gradle
on:
push:
branches:
- '**' # Build on push to any branch
pull_request:
branches:
- master # Build and push on pull requests to master branch
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build Docker JVM Image
run: docker build --no-cache --file ./jvm.Dockerfile .
- name: Build Docker Native Image
run: docker build --no-cache --file ./native.Dockerfile .
push-native-image:
needs: build
if: github.event_name == 'pull_request' && github.base_ref == 'refs/heads/master' # Run this job only on pull requests to master branch
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker Native Image
run: |
docker build --file ./native.Dockerfile . --tag ghcr.io/${{ github.repository }}/native:pr-${{ github.event.pull_request.number }}
docker push ghcr.io/${{ github.repository }}/native:pr-${{ github.event.pull_request.number }}