44 lines
1.0 KiB
YAML
44 lines
1.0 KiB
YAML
|
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
|