Skip to content

CI(Build and push to docker hub) #77

CI(Build and push to docker hub)

CI(Build and push to docker hub) #77

name: CI(Build and push to docker hub)
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Build with Maven
run: mvn package install -Dmaven.test.skip=true -Pprod
- name: Set up Node.js 16
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install with nodejs
run: cd admin-ui && npm install
- name: Build with nodejs
run: cd admin-ui && npm run build:production
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Login to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push 认证中心服务
uses: docker/build-push-action@v3
with:
context: auth-center
platforms: linux/amd64,linux/arm64/v8
push: true
tags: |
dlhf/auth-center:latest
ghcr.io/jgzl/auth-center:latest
- name: Build and push 系统中心服务
uses: docker/build-push-action@v3
with:
context: system-center
platforms: linux/amd64,linux/arm64/v8
push: true
tags: |
dlhf/system-center:latest
ghcr.io/jgzl/system-center:latest
- name: Build and push 网关管理服务前端
uses: docker/build-push-action@v3
with:
context: admin-ui
platforms: linux/amd64,linux/arm64/v8
push: true
tags: |
dlhf/admin-ui:latest
ghcr.io/jgzl/admin-ui:latest
- name: Build and push 网关管理服务后端
uses: docker/build-push-action@v3
with:
context: gateway/gateway-admin-center
platforms: linux/amd64,linux/arm64/v8
push: true
tags: |
dlhf/gateway-admin-center:latest
ghcr.io/jgzl/gateway-admin-center:latest
- name: Build and push 网关中心服务
uses: docker/build-push-action@v3
with:
context: gateway/gateway-center
platforms: linux/amd64,linux/arm64/v8
push: true
tags: |
dlhf/gateway-center:latest
ghcr.io/jgzl/gateway-center:latest
- name: Build and push 消息中心服务
uses: docker/build-push-action@v3
with:
context: message-center
platforms: linux/amd64,linux/arm64/v8
push: true
tags: |
dlhf/message-center:latest
ghcr.io/jgzl/message-center:latest
- name: Build and push 工具中心服务
uses: docker/build-push-action@v3
with:
context: tool-center
platforms: linux/amd64,linux/arm64/v8
push: true
tags: |
dlhf/tool-center:latest
ghcr.io/jgzl/tool-center:latest
- name: Build and push 监控中心服务
uses: docker/build-push-action@v3
with:
context: monitor-center
platforms: linux/amd64,linux/arm64/v8
push: true
tags: |
dlhf/monitor-center:latest
ghcr.io/jgzl/monitor-center:latest