Skip to content

Commit

Permalink
Merge pull request #5 from garamb1/workflows
Browse files Browse the repository at this point in the history
GitHub Actions, publish to Docker Hub
  • Loading branch information
garamb1 committed Nov 25, 2023
2 parents 3455900 + b09c598 commit bf6add4
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 29 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/gradle-pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ jobs:
with:
java-version: '17'
distribution: 'temurin'
- name: Spotless Check
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with:
arguments: spotlessCheck
- name: Build
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle

name: Gradle Build & Package
name: Publish Docker Image

on:
release:
Expand All @@ -21,6 +21,11 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Read VERSION file
id: getVersion
run: echo "version=$(cat ./VERSION)" >> "$GITHUB_ENV"
- name: Print Release Version
run: printf '%s\n' "$version"
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
Expand All @@ -29,12 +34,18 @@ jobs:
- name: Build with Gradle
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with:
arguments: build
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
- name: Publish package
uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629
arguments: -P${{ env.version }} build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
arguments: publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: garambo/retrosearch:${{ env.version }}
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM eclipse-temurin:17
MAINTAINER garambo.it
ARG JAR_FILE=build/libs/*.jar
COPY ${JAR_FILE} retrosearch.jar
ENTRYPOINT ["java","-jar","/retrosearch.jar"]
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@

Search and Browse the WWW like it's 1997.

![RetroSearch on Netscape 2.0 and IE 5](https://github.com/garamb1/retrosearch/assets/3776646/aa7356ce-aa64-48fc-84c2-c5a34fd99474)
[![Published on DockerHub](https://github.com/garambo/retrosearch/actions/workflows/publish.yml/badge.svg)
](https://hub.docker.com/repository/docker/garambo/retrosearch)

![RetroSearch on Netscape 2.0 and IE 5](https://github.com/garamb1/retrosearch/assets/3776646/aa7356ce-aa64-48fc-84c2-c5a34fd99474)

## How does it work?

Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1-testing
15 changes: 0 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
plugins {
id 'java'
id 'maven-publish'
id 'org.springframework.boot' version '3.1.5'
id 'io.spring.dependency-management' version '1.1.3'
id 'com.diffplug.spotless' version "6.22.0"
}

group = 'it.garambo'
version = '0.0.1-SNAPSHOT'

spotless {
java {
Expand All @@ -17,19 +15,6 @@ spotless {
}
}

publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/garamb1/retrosearch")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}

java {
sourceCompatibility = '17'
}
Expand Down

0 comments on commit bf6add4

Please sign in to comment.