This commit is contained in:
@@ -23,12 +23,16 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-node # 如果host构建 :linux_amd64
|
||||
steps:
|
||||
- run: echo " The job was automatically triggered by a ${{ gitea.event_name }} event."
|
||||
- run: echo " This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
||||
- run: echo " The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
||||
- run: env
|
||||
|
||||
- run: apt-get update && apt-get install -y gettext
|
||||
- name: Print system info 1
|
||||
run: echo " The job was automatically triggered by a ${{ gitea.event_name }} event."
|
||||
- name: Print system info 2
|
||||
run: echo " This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
||||
- name: Print system info 3
|
||||
run: echo " The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
||||
- name: Print env
|
||||
run: env
|
||||
- name: Install dependencies
|
||||
run: apt-get update && apt-get install -y gettext
|
||||
|
||||
# - uses: http://localhost:3000/bamanker/setup-node@v6
|
||||
# with:
|
||||
@@ -38,7 +42,7 @@ jobs:
|
||||
# 下载仓库源码,依赖node环境,因此构建服务器本地需要下载安装node并设置环境变量
|
||||
- name: Checkout repository code
|
||||
#使用自定义仓库action
|
||||
uses: http://localhost:3000/bamanker/checkout@v6
|
||||
uses: http://139.9.216.111:3000/bamanker/checkout@v6
|
||||
|
||||
# 获取 TAG 并设置为环境变量
|
||||
- name: Get version
|
||||
@@ -63,7 +67,7 @@ jobs:
|
||||
|
||||
# 构建java项目
|
||||
- name: Set up Java
|
||||
uses: http://localhost:3000/bamanker/setup-java@v5
|
||||
uses: http://139.9.216.111:3000/bamanker/setup-java@v5
|
||||
with:
|
||||
distribution: 'graalvm'
|
||||
java-version: '25.0.1'
|
||||
@@ -75,7 +79,7 @@ jobs:
|
||||
|
||||
# 登录镜像仓库,方便后续上传镜像
|
||||
- name: Login to Docker Registry
|
||||
uses: http://localhost:3000/bamanker/login-action@v3
|
||||
uses: http://139.9.216.111:3000/bamanker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
@@ -90,7 +94,7 @@ jobs:
|
||||
|
||||
# 构建并上传镜像
|
||||
- name: Build and push Docker image
|
||||
uses: http://localhost:3000/bamanker/build-push-action@v6 # 获取上一步截取到的版本号,既 1.0.0
|
||||
uses: http://139.9.216.111:3000/bamanker/build-push-action@v6 # 获取上一步截取到的版本号,既 1.0.0
|
||||
#只能这样接收
|
||||
env:
|
||||
TAG: ${{ steps.set_envar.outputs.tag }}
|
||||
@@ -103,7 +107,7 @@ jobs:
|
||||
|
||||
#发布到 k8s
|
||||
- name: Generate kubeconfig
|
||||
uses: http://localhost:3000/bamanker/kubectl-action@v1.4.0
|
||||
uses: http://139.9.216.111:3000/bamanker/kubectl-action@v1.4.0
|
||||
with:
|
||||
base64-kube-config: ${{ secrets.KUBE_CONFIG }}
|
||||
- name: Deploy k8s
|
||||
|
||||
Reference in New Issue
Block a user