Skip to content

Commit 44b781e

Browse files
Create build_docker.yml
1 parent b2b7eb7 commit 44b781e

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/build_docker.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: Node.js CI
5+
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
image_version:
10+
description: 'The version of the Docker image'
11+
required: true
12+
default: 'dev'
13+
#push:
14+
#branches: [ "main" ]
15+
#pull_request:
16+
#branches: [ "main" ]
17+
18+
jobs:
19+
build:
20+
21+
runs-on: ubuntu-latest
22+
23+
strategy:
24+
matrix:
25+
node-version: [22.x]
26+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
- name: Use Node.js ${{ matrix.node-version }}
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: ${{ matrix.node-version }}
34+
cache: 'npm'
35+
- name: Install and build
36+
run: |
37+
cd ./frontend
38+
npm install
39+
npm run build
40+
cp -r ./dist ../backend/
41+
cd ../backend
42+
- name: Build Image
43+
run: docker build -t registry.cn-shanghai.aliyuncs.com/dataease-v2/sqlbot:${{ inputs.image_version }} .
44+
- name: Login registry
45+
run: docker login registry.cn-shanghai.aliyuncs.com --username=划船不用桨_小白 --password=1qaz@WSX
46+
- name: Push Image
47+
run: docker push registry.cn-shanghai.aliyuncs.com/dataease-v2/sqlbot:${{ inputs.image_version }}

0 commit comments

Comments
 (0)