Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

self hosted runners #8

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main_commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
24 changes: 0 additions & 24 deletions .github/workflows/pr_close.yml

This file was deleted.

62 changes: 1 addition & 61 deletions .github/workflows/pr_create.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Тесты и раскатка на Pull Request
name: Тесты на Pull Request

on: pull_request

Expand Down Expand Up @@ -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 }}"
}'
Loading