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