From e8cf4a20ad3c8ca1dd17bb992bf0f0c81b5dd750 Mon Sep 17 00:00:00 2001 From: hoangvv Date: Thu, 9 Jan 2025 17:59:35 +0700 Subject: [PATCH] update --- .github/workflows/build.yml | 17 ---------- .github/workflows/setup_docker.yml | 50 ++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 17 deletions(-) delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/setup_docker.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 5b3dd7f9e..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: GitHub Actions Example -on: - push: - branches: [ main ] -jobs: - build: - runs-on: self-hosted - strategy: - matrix: - python: - - 3.12.7 - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - - name: get commit hash - run: pyenv virtualenv "$(git rev-parse --short "$GITHUB_SHA")" \ No newline at end of file diff --git a/.github/workflows/setup_docker.yml b/.github/workflows/setup_docker.yml new file mode 100644 index 000000000..5531ef0d8 --- /dev/null +++ b/.github/workflows/setup_docker.yml @@ -0,0 +1,50 @@ +name: GitHub Actions Example +on: + push: + branches: [ main ] +jobs: + setup_env: + runs-on: self-hosted + strategy: + matrix: + python: + - 3.12.7 + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + - name: Create virtual environment + run: pyenv virtualenv "$(git rev-parse --short "$GITHUB_SHA")" + - name: Create virtual environment + run: pyenv virtualenv "$(git rev-parse --short "$GITHUB_SHA")" + build: + runs-on: self-hosted + steps: + - name: Stop Server Docker + uses: make stop_server_docker + - name: Generate Config + uses: make gen_config + - name: Build Image + uses: make build_image + start: + runs-on: self-hosted + steps: + - name: Start Server + uses: make run_server_docker + - name: Restore Database + uses: make restore_database + test: + runs-on: self-hosted + steps: + - name: Start Server + uses: make run_test_docker + publish: + runs-on: self-hosted + steps: + - name: Push Image + uses: make push_image + clean_up: + runs-on: self-hosted + steps: + - name: Cleanup + run: make clean_up