-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from evgri243/evgri243/add-docker-container
* Added Dockerfile to create a containerized environment with pre-installed dependencies for running the plugin. * Updated runPluginStarter.sh to add default values and better error handling for arguments. * Updated GitHub Actions workflow (build.yml) to include building and pushing of Docker images to the GitHub Container Registry. * Moved .github folder to the repository root to make it visible to GitHub Actions.
- Loading branch information
Showing
4 changed files
with
129 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
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 | ||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
- name: Set up JDK 17 | ||
uses: actions/[email protected] | ||
with: | ||
java-version: 17 | ||
distribution: liberica | ||
- name: Build plugin | ||
run: ./gradlew buildPlugin | ||
working-directory: ide-former-plugin | ||
|
||
# build docker container | ||
docker: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
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 | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM ubuntu:20.04 | ||
|
||
# Install Java | ||
RUN apt-get update && apt-get install -y \ | ||
openjdk-17-jdk \ | ||
&& java -version | ||
|
||
# Install Git | ||
RUN apt-get install -y \ | ||
git \ | ||
&& git --version | ||
|
||
# Install Python3 and pip3 | ||
RUN apt-get update && apt-get install -y \ | ||
python3 \ | ||
python3-pip \ | ||
python3-setuptools \ | ||
python3-wheel \ | ||
&& python3 --version | ||
|
||
# Disable gradle daemon | ||
ENV GRADLE_OPTS "-Dorg.gradle.daemon=false" | ||
|
||
# Copy the plugin | ||
COPY ide-former-plugin /ide-former-plugin | ||
|
||
# prebuild the plugin with gradle | ||
RUN cd /ide-former-plugin && ./gradlew buildPlugin | ||
|
||
ENTRYPOINT ["bash", "/ide-former-plugin/runPluginStarter.sh"] | ||
|
||
CMD [] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters