forked from halo-dev/halo
-
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.
Refactor CICD for Halo next (halo-dev#2236)
- Loading branch information
Showing
7 changed files
with
61 additions
and
261 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,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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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 |
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