From f1fdb5267c111f5272cac2a5d6cd427a2ac0ebf4 Mon Sep 17 00:00:00 2001 From: Evgeny Grigorenko Date: Fri, 3 Nov 2023 16:34:26 +0100 Subject: [PATCH] Fix Actions definition --- .github/workflows/build.yml | 34 +++++++++++++++++++++------------- Dockerfile | 2 +- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c41acaa..f9e5b74 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,18 @@ -name: Gradle Build +name: Build & Push + +on: + push: + branches: + - main + pull_request: + branches: + - main + +# cancel workflow if there is already one running +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true -on: [push, pull_request] -branches: - only: - - master jobs: build: @@ -16,13 +25,11 @@ jobs: with: java-version: 17 distribution: liberica - - name: Gradle Wrapper Validation - uses: gradle/wrapper-validation-action@v1.0.4 - - uses: gradle/gradle-build-action@v2.1.5 - with: - arguments: build --stacktrace + - name: Build plugin + run: ./gradlew buildPlugin + working-directory: ide-former-plugin -# build docker container + # build docker container docker: runs-on: ubuntu-latest @@ -43,9 +50,10 @@ jobs: with: context: . file: ./Dockerfile - push: ${{ github.ref == 'refs/heads/master' }} - platforms: linux/amd64,linux/arm64 + push: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} + platforms: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' && 'linux/amd64,linux/arm64' || 'linux/amd64' }} tags: ghcr.io/${{ github.repository }}/runner:latest,ghcr.io/${{ github.repository }}/runner:${{ github.sha }} + cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/runner:latest diff --git a/Dockerfile b/Dockerfile index 601f7ed..1855ef5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM ubuntu:20.04 # Install Java RUN apt-get update && apt-get install -y \ - openjdk-11-jdk \ + openjdk-17-jdk \ && java -version # Install Git