mirror of
https://github.com/aimingmed/aimingmed-ai.git
synced 2026-02-08 08:13:20 +08:00
use github runner again
This commit is contained in:
parent
08a45a9c76
commit
036a01f5ef
13
.github/workflows/develop.yml
vendored
13
.github/workflows/develop.yml
vendored
@ -1,6 +1,6 @@
|
|||||||
name: CI/CD - develop
|
name: CI/CD - develop
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- develop
|
- develop
|
||||||
@ -9,10 +9,9 @@ env:
|
|||||||
IMAGE: ghcr.io/$(echo $GITHUB_REPOSITORY | tr '[A-Z]' '[a-z]')/aimingmed-ai-backend
|
IMAGE: ghcr.io/$(echo $GITHUB_REPOSITORY | tr '[A-Z]' '[a-z]')/aimingmed-ai-backend
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build Docker Image
|
name: Build Docker Image
|
||||||
runs-on: self-hosted
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
@ -41,7 +40,7 @@ jobs:
|
|||||||
|
|
||||||
test:
|
test:
|
||||||
name: Test Docker Image
|
name: Test Docker Image
|
||||||
runs-on: self-hosted
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@ -62,7 +61,7 @@ jobs:
|
|||||||
--tag ${{ env.IMAGE }}:latest \
|
--tag ${{ env.IMAGE }}:latest \
|
||||||
--file ./app/backend/Dockerfile.prod \
|
--file ./app/backend/Dockerfile.prod \
|
||||||
"./app/backend"
|
"./app/backend"
|
||||||
|
|
||||||
- name: Run container
|
- name: Run container
|
||||||
run: |
|
run: |
|
||||||
docker run \
|
docker run \
|
||||||
@ -74,7 +73,7 @@ jobs:
|
|||||||
-e TESTING=0 \
|
-e TESTING=0 \
|
||||||
-p 8004:8765 \
|
-p 8004:8765 \
|
||||||
${{ env.IMAGE }}:latest
|
${{ env.IMAGE }}:latest
|
||||||
|
|
||||||
- name: Pytest
|
- name: Pytest
|
||||||
run: docker exec backend pipenv run python -m pytest tests --disable-warnings
|
run: docker exec backend pipenv run python -m pytest tests --disable-warnings
|
||||||
# - name: Flake8
|
# - name: Flake8
|
||||||
@ -85,4 +84,4 @@ jobs:
|
|||||||
# run: docker exec backend pipenv run python -m isort . --check-only
|
# run: docker exec backend pipenv run python -m isort . --check-only
|
||||||
- name: Cleanup container at end of job
|
- name: Cleanup container at end of job
|
||||||
if: always()
|
if: always()
|
||||||
run: docker stop backend || true && docker rm backend || true
|
run: docker stop backend || true && docker rm backend || true
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user