增加 build.yaml
Some checks failed
wance-data CI/CD / build (push) Failing after 19s

This commit is contained in:
zhangjunping 2024-11-29 08:07:24 +00:00
parent 023cc64d20
commit 52f959fe9e

@ -0,0 +1,44 @@
name: wance-data CI/CD
on:
push:
branches:
- dev
pull_request:
branches:
- dev
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
# - name: Set up Python
# uses: actions/setup-python@v2
# with:
# python-version: '3.11'
#
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple/
# pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
#
# - name: Run tests
# run: |
# chmod +x ./scripts/start-prod.sh
# ./scripts/start-prod.sh
- name: Build Docker image
run: |
docker build -t wance-data:latest .
- name: Stop and remove existing container
run: |
docker stop wance-data || true
docker rm wance-data || true
- name: Run Docker container
run: |
docker run -d -p 8012:8012 --name wance-api wance-api:latest