Skip to content

Commit

Permalink
Refactor CICD for Halo next (halo-dev#2236)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnNiang authored Jul 12, 2022
1 parent c978047 commit 5953d22
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 261 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/halo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Halo CI

on:
pull_request:
paths:
- "**"
- "!**.md"
push:
branches:
- "**"
paths:
- "**"
- "!**.md"
release:
types: # This configuration does not affect the page_build event above
- created

jobs:
check:
runs-on: ubuntu-latest
# Default steps
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
cache: 'gradle'
java-version: 17
- name: Check code style
run: ./gradlew check -x test
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
cache: 'gradle'
java-version: 17
- name: Run tests
run: ./gradlew test
docker-build-and-push:
runs-on: ubuntu-latest
needs: test
steps:
- uses: halo-sigs/actions/halo-next-docker-build@main # change the version to specific ref or release tag while the action is stable.
with:
image-name: halodev
ghcr-token: ${{ secrets.GHCR_TOKEN }}
push: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/next' }} # we only push to GHCR if the push is to the next branch
158 changes: 0 additions & 158 deletions .github/workflows/halo.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/needs-more-info-closer.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/on-comment.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/on-label.yml

This file was deleted.

13 changes: 5 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
FROM adoptopenjdk:11-jre-hotspot as builder
FROM eclipse-temurin:17-jre as builder
WORKDIR application
ARG JAR_FILE=build/libs/*.jar
ARG JAR_FILE=build/libs/halo-*.jar
COPY ${JAR_FILE} application.jar
RUN java -Djarmode=layertools -jar application.jar extract

################################

FROM adoptopenjdk:11-jre-hotspot
FROM eclipse-temurin:17-jre
MAINTAINER johnniang <[email protected]>
WORKDIR application
COPY --from=builder application/dependencies/ ./
COPY --from=builder application/spring-boot-loader/ ./
COPY --from=builder application/snapshot-dependencies/ ./
COPY --from=builder application/application/ ./

# JVM_XMS and JVM_XMX configs deprecated for removal in halov1.4.4
ENV JVM_XMS="256m" \
JVM_XMX="256m" \
JVM_OPTS="-Xmx256m -Xms256m" \
ENV JVM_OPTS="-Xmx256m -Xms256m" \
TZ=Asia/Shanghai

RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone

ENTRYPOINT java -Xms${JVM_XMS} -Xmx${JVM_XMX} ${JVM_OPTS} -Djava.security.egd=file:/dev/./urandom org.springframework.boot.loader.JarLauncher
ENTRYPOINT java ${JVM_OPTS} -Djava.security.egd=file:/dev/./urandom org.springframework.boot.loader.JarLauncher
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ configurations {
}

bootJar {
launchScript()
manifest {
attributes "Implementation-Title": "Halo Application",
"Implementation-Version": archiveVersion
Expand Down

0 comments on commit 5953d22

Please sign in to comment.