Skip to content

Commit

Permalink
build: add Aliyun registry
Browse files Browse the repository at this point in the history
  • Loading branch information
lichong-a committed Aug 9, 2024
1 parent ea3389c commit e67cb75
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 7 deletions.
18 changes: 17 additions & 1 deletion .github/actions/docker-buildx-push/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inputs:
required: false
default: ""
dockerhub-user:
description: "User name for the DockerHub account"
description: User name for the DockerHub account
required: false
default: ""
dockerhub-token:
Expand All @@ -26,6 +26,14 @@ inputs:
description: The basic name of docker.
required: false
default: "portal-server"
aliyun-registry-user:
description: User name for the Aliyun registry
required: false
default: ""
aliyun-registry-password:
description: Token for the Aliyun registry
required: false
default: ""

runs:
using: "composite"
Expand All @@ -37,6 +45,7 @@ runs:
images: |
ghcr.io/${{ github.repository_owner }}/${{ inputs.image-name }}
${{ inputs.dockerhub-user }}/${{ inputs.image-name }}
registry.cn-beijing.aliyuncs.com/${{ inputs.aliyun-registry-user }}/${{ inputs.image-name }}
tags: |
type=schedule,pattern=nightly-{{date 'YYYYMMDD'}},enabled=${{ github.event_name == 'schedule' }}
type=ref,event=branch,enabled=${{ github.event_name == 'push' }}
Expand Down Expand Up @@ -64,6 +73,13 @@ runs:
with:
username: ${{ inputs.dockerhub-user }}
password: ${{ inputs.dockerhub-token }}
- name: Login to Aliyun
uses: docker/login-action@v3
if: inputs.aliyun-registry-password != '' && github.event_name != 'pull_request'
with:
registry: registry.cn-beijing.aliyuncs.com
username: ${{ inputs.aliyun-registry-user }}
password: ${{ inputs.aliyun-registry-password }}
- name: Build and push
uses: docker/build-push-action@v5
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,7 @@ jobs:
ghcr-token: ${{ secrets.GITHUB_TOKEN }}
dockerhub-user: ${{ secrets.DOCKER_USERNAME }}
dockerhub-token: ${{ secrets.DOCKER_TOKEN }}
aliyun-registry-user: ${{ secrets.ALIYUN_REGISTRY_USER }}
aliyun-registry-password: ${{ secrets.ALIYUN_REGISTRY_PASSWORD }}
push: true
platforms: linux/amd64,linux/arm64/v8,linux/ppc64le,linux/s390x
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ COPY starter/src/main/resources/application.yml config/application.yml
COPY starter/src/main/resources/docker/.env config/.env

ENV JVM_OPTS="-Xmx512m -Xms2048m" \
APP_OPS="--spring.config.import=optional:file:config/.env[.properties]" \
TZ=Asia/Shanghai

EXPOSE 8080

ENTRYPOINT [ "java ${JVM_OPTS} -jar application.jar --spring.config.import=optional:file:config/.env[.properties]" ]
CMD java ${JVM_OPTS} -jar application.jar ${APP_OPS}
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,4 @@ public class BaseEntity {
@Comment("乐观锁版本号")
public long version;

public static final class ColumnName {
public static final String CREATED_AT = "created_at";
public static final String UPDATED_AT = "updated_at";
public static final String VERSION = "version";
}
}
9 changes: 9 additions & 0 deletions starter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ bootJar {
}
}

graalvmNative {
toolchainDetection = true
binaries {
main {
verbose = true
}
}
}

dependencies {
implementation project(':common:core')
implementation project(':module:system')
Expand Down

0 comments on commit e67cb75

Please sign in to comment.