[ADD] 添加数据库逻辑 #4
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
name: Release to Github Packages | |
on: | |
push: | |
branches: | |
- master | |
- '*.x' | |
jobs: | |
# 构建应用组件并发布到 GitHub Packages | |
release-to-github-packages: | |
name: Release to Github Packages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up nodejs | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Cache maven packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Set up java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: zulu | |
server-id: github | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
gpg-passphrase: GPG_PASSPHRASE | |
- name: Release packages to GitHub Packages | |
run: | | |
# 覆盖 maven settings.xml 文件,添加自定义 profiles | |
# 先 install maven-studio-parent 到 local repository | |
# 再安装 central-studio-views 下项目的 npm 依赖 | |
# 最后再来发布类库 | |
rm ~/.m2/settings.xml & cp ${{ github.workspace }}/.github/.m2/settings.xml ~/.m2/settings.xml & | |
mvn -P github --batch-mode clean install -pl :central-studio-parent & | |
mvn -P github exec:exec@npm-install -pl :central-dashboard-view,:central-identity-view & | |
mvn -P github --batch-mode clean deploy | |
env: | |
MAVEN_USERNAME: ${{ secrets.GHPKG_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.GHPKG_TOKEN }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
# 构建应用组件并发布到 GitHub Packages | |
release-docker-images: | |
name: Release Docker Images | |
runs-on: ubuntu-latest | |
needs: [release-to-github-packages] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: zulu | |
server-id: github | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
gpg-passphrase: GPG_PASSPHRASE | |
- name: Set up Docker(QEMU) | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker(Buildx) | |
uses: docker/setup-buildx-action@v3 | |
with: | |
driver-opts: image=moby/buildkit:master | |
platforms: linux/amd64,linux/arm64 | |
- name: Login to GitHub Packages | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ secrets.GHPKG_USERNAME }} | |
password: ${{ secrets.GHPKG_TOKEN }} | |
- name: Package | |
run: | | |
# 覆盖 maven settings.xml 文件,添加自定义 profiles | |
# 打包应用组件 | |
rm ~/.m2/settings.xml & cp ${{ github.workspace }}/.github/.m2/settings.xml ~/.m2/settings.xml & | |
mvn -P github --batch-mode clean package -pl :central-bootstrap | |
env: | |
MAVEN_USERNAME: ${{ secrets.GHPKG_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.GHPKG_TOKEN }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Release images to GitHub Packages | |
uses: docker/bake-action@v5 | |
with: | |
push: true | |
env: | |
REGISTRY: ghcr.io | |
REPOSITORY: central-x |