70 lines
2.2 KiB
YAML
70 lines
2.2 KiB
YAML
name: 'Build Agent'
|
|
run-name: '${{ inputs.branch }} :: ${{ gitea.run_number }}'
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
test_env:
|
|
description: 'активное окружение'
|
|
required: true
|
|
type: choice
|
|
options:
|
|
- test
|
|
- devx
|
|
default: test
|
|
gradle_target:
|
|
description: 'Цель сборки'
|
|
required: true
|
|
type: choice
|
|
options:
|
|
- 'apiTest'
|
|
- 'apiCoreTest'
|
|
- 'apiBffTest'
|
|
default: 'apiTest'
|
|
jobs:
|
|
deploy-dev:
|
|
name: 'Deploy to dev'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: 'Print Info'
|
|
run: |
|
|
echo "Cloning ${{ github.event.inputs.repo_path }}"
|
|
echo "From branch ${{ github.event.inputs.branch }}"
|
|
- name: Cloning
|
|
uses: https://git.binom.pw/otp/devops/clone@main
|
|
with:
|
|
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
repository: 'devspc/devspace-autotests'
|
|
branch: ${{ github.event.inputs.branch }}
|
|
- name: 'Конфигурирование интеграции gradle'
|
|
uses: https://git.binom.pw/otp/devops/config-gradle@main
|
|
- name: 'Конфигурирование gradle wrapper'
|
|
uses: https://git.binom.pw/otp/devops/setup-gradle@main
|
|
- name: Setup Jvm
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: 21
|
|
distribution: "adopt"
|
|
- name: Building
|
|
run: |
|
|
./gradlew ${{ input.gradle_target }} --no-daemon -x cyclonedxBom \
|
|
-Dtest.env=${{ input.test_env }}
|
|
- name: Build and push Docker Image
|
|
uses: https://git.binom.pw/subochev/devops/build-docker@main
|
|
with:
|
|
image_name: "otp/agent"
|
|
tags: latest ${{ gitea.run_number }}
|
|
- name: Publishing Helm
|
|
uses: https://git.binom.pw/subochev/devops/helm-publish@main
|
|
with:
|
|
chart_directory: "helm"
|
|
helm_version: "${{ gitea.run_number }}"
|
|
helm_version_placeholder: '0.1.0'
|
|
|
|
- name: 'Cleanup'
|
|
if: always()
|
|
shell: bash
|
|
run: |
|
|
echo 'Cleaning...'
|
|
rm -rf ~/.gradle/init.gradle.kts
|
|
rm -rf ~/.ssh/config
|
|
rm -rf ~/.ssh/my_key |