From 52f959fe9ea36097c54d3d4bf4e59843fe1a8cd8 Mon Sep 17 00:00:00 2001 From: zhangjunping Date: Fri, 29 Nov 2024 08:07:24 +0000 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20build.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/build.yaml | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .gitea/workflows/build.yaml diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..e5f95e8 --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -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 \ No newline at end of file