From 4eeb0f90194a0e0bf227f6efee585acc02485935 Mon Sep 17 00:00:00 2001 From: Grigoriev Semyon <33061489+grigoriev-semyon@users.noreply.github.com> Date: Sat, 22 Jun 2024 00:25:57 +0300 Subject: [PATCH] self hosted runners (#8) --- .github/workflows/main_commit.yml | 2 +- .github/workflows/main_release.yml | 6 +-- .github/workflows/pr_close.yml | 24 ------------ .github/workflows/pr_create.yml | 62 +----------------------------- 4 files changed, 5 insertions(+), 89 deletions(-) delete mode 100644 .github/workflows/pr_close.yml diff --git a/.github/workflows/main_commit.yml b/.github/workflows/main_commit.yml index e9cce83..e7608ce 100644 --- a/.github/workflows/main_commit.yml +++ b/.github/workflows/main_commit.yml @@ -97,7 +97,7 @@ jobs: deploy-test: name: Раскатываем тестовый Docker - runs-on: [self-hosted, Linux] + runs-on: [ self-hosted, Linux, testing ] needs: build-test-image environment: name: Testing diff --git a/.github/workflows/main_release.yml b/.github/workflows/main_release.yml index dd7c8b2..223de59 100644 --- a/.github/workflows/main_release.yml +++ b/.github/workflows/main_release.yml @@ -92,7 +92,7 @@ jobs: deploy-preprod: name: Раскатываем pre-prod среду - runs-on: [self-hosted, Linux] + runs-on: [ self-hosted, Linux, testing ] needs: build-preprod-image environment: name: Preprod @@ -115,7 +115,7 @@ jobs: undeploy-preprod: name: Останавливаем pre-prod среду - runs-on: [self-hosted, Linux] + runs-on: [ self-hosted, Linux, testing ] needs: deploy-preprod environment: name: Preprod @@ -130,7 +130,7 @@ jobs: deploy-production: name: Раскатываем production среду - runs-on: [self-hosted, Linux] + runs-on: [ self-hosted, Linux, production ] needs: [deploy-preprod, build-prod-image] environment: name: Production diff --git a/.github/workflows/pr_close.yml b/.github/workflows/pr_close.yml deleted file mode 100644 index cf5bb4f..0000000 --- a/.github/workflows/pr_close.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Тесты и раскатка на Pull Request (остановка) - -on: - pull_request: - types: [closed] - -jobs: - stop-deployment-dev: - name: Останавливаем dev среду - runs-on: ubuntu-latest - environment: - name: development-pr-${{ github.event.pull_request.number }} - steps: - - name: Stop deployment - run: | - curl -X 'POST' \ - 'https://ci.dev.profcomff.com/pr_stop' \ - -H 'accept: application/json' \ - -H 'Content-Type: application/json' \ - -H 'Authorization: ${{ secrets.CI_DYAKOVSPACE_MSK_TOKEN }}' \ - -d '{ - "repo_url": "${{ github.repository }}", - "git_ref": "${{ github.ref }}" - }' diff --git a/.github/workflows/pr_create.yml b/.github/workflows/pr_create.yml index c6d7408..4f297e4 100644 --- a/.github/workflows/pr_create.yml +++ b/.github/workflows/pr_create.yml @@ -1,4 +1,4 @@ -name: Тесты и раскатка на Pull Request +name: Тесты на Pull Request on: pull_request @@ -50,63 +50,3 @@ jobs: - name: Check run: pnpm test - - build-and-push-image: - name: Собираем dev Docker - runs-on: ubuntu-latest - needs: - - test - - test-format - permissions: - contents: read - packages: write - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Log in to the Container registry - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v4 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Build and push Docker image - uses: docker/build-push-action@v4 - with: - file: ./deployment/Dockerfile - context: . - push: true - build-args: | - BUILD_MODE=testing - LAUNCH_MODE=development-${{ github.event.pull_request.number }} - APP_VERSION=${{ github.ref_name }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - - deploy-dev: - name: Раскатываем dev среду - runs-on: ubuntu-latest - needs: build-and-push-image - environment: - name: development-pr-${{ github.event.pull_request.number }} - url: https://${{ github.event.repository.name }}__pr-${{ github.event.pull_request.number }}.dev.profcomff.com/ - steps: - - name: Deploy - run: | - curl -X 'POST' \ - 'https://ci.dev.profcomff.com/pr_run' \ - -H 'accept: application/json' \ - -H 'Content-Type: application/json' \ - -H 'Authorization: ${{ secrets.CI_DYAKOVSPACE_MSK_TOKEN }}' \ - -d '{ - "repo_url": "${{ github.repository }}", - "git_ref": "${{ github.ref }}" - }'