|
@@ -8,8 +8,69 @@ on:
|
|
|
default: 'demo'
|
|
|
|
|
|
jobs:
|
|
|
+ build:
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ steps:
|
|
|
+ - uses: actions/checkout@v3
|
|
|
+ - name: get branch name
|
|
|
+ id: extract_branch
|
|
|
+ run: |
|
|
|
+ tag='${{ github.event.inputs.ENV_NAME }}-$(date '+%F-%H-%M-%S')'
|
|
|
+ echo "tag=${tag}" >> $GITHUB_OUTPUT
|
|
|
+ env:
|
|
|
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
+ - name: Set up JDK
|
|
|
+ uses: actions/setup-java@v3
|
|
|
+ with:
|
|
|
+ java-version: '17'
|
|
|
+ distribution: 'zulu'
|
|
|
+ cache: 'maven'
|
|
|
+ - name: Build
|
|
|
+ id: build
|
|
|
+ run: |
|
|
|
+ ./mvnw -B -ntp versions:set -DnewVersion=$GITHUB_SHA
|
|
|
+ ./mvnw -B -V -ntp clean package -Pprod -DskipTests
|
|
|
+ export VERSION=$(./mvnw -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
|
|
|
+ echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
|
|
+ - name: Set up QEMU
|
|
|
+ uses: docker/setup-qemu-action@v2
|
|
|
+ - name: Set up Docker Buildx
|
|
|
+ id: buildx
|
|
|
+ uses: docker/setup-buildx-action@v2
|
|
|
+ - name: Cache Docker layers
|
|
|
+ uses: actions/cache@v3
|
|
|
+ with:
|
|
|
+ path: /tmp/.buildx-cache
|
|
|
+ key: ${{ runner.os }}-buildx-${{ github.sha }}
|
|
|
+ restore-keys: |
|
|
|
+ ${{ runner.os }}-buildx-
|
|
|
+ - name: Configure AWS credentials for Kafka-UI account
|
|
|
+ uses: aws-actions/configure-aws-credentials@v1
|
|
|
+ with:
|
|
|
+ aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
|
+ aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
|
+ aws-region: eu-central-1
|
|
|
+ - name: Login to Amazon ECR
|
|
|
+ id: login-ecr
|
|
|
+ uses: aws-actions/amazon-ecr-login@v1
|
|
|
+ - name: Build and push
|
|
|
+ id: docker_build_and_push
|
|
|
+ uses: docker/build-push-action@v3
|
|
|
+ with:
|
|
|
+ builder: ${{ steps.buildx.outputs.name }}
|
|
|
+ context: kafka-ui-api
|
|
|
+ push: true
|
|
|
+ tags: 297478128798.dkr.ecr.eu-central-1.amazonaws.com/kafka-ui:${{ steps.extract_branch.outputs.tag }}
|
|
|
+ build-args: |
|
|
|
+ JAR_FILE=kafka-ui-api-${{ steps.build.outputs.version }}.jar
|
|
|
+ cache-from: type=local,src=/tmp/.buildx-cache
|
|
|
+ cache-to: type=local,dest=/tmp/.buildx-cache
|
|
|
+ outputs:
|
|
|
+ tag: ${{ steps.extract_branch.outputs.tag }}
|
|
|
+
|
|
|
separate-env-create:
|
|
|
runs-on: ubuntu-latest
|
|
|
+ needs: build
|
|
|
steps:
|
|
|
- name: clone
|
|
|
run: |
|
|
@@ -18,7 +79,7 @@ jobs:
|
|
|
- name: separate env create
|
|
|
run: |
|
|
|
cd kafka-ui-infra/aws-infrastructure4eks/argocd/scripts
|
|
|
- bash separate_env_create.sh ${{ github.event.inputs.ENV_NAME }} ${{ secrets.FEATURE_TESTING_UI_PASSWORD }}
|
|
|
+ bash separate_env_create.sh ${{ github.event.inputs.ENV_NAME }} ${{ secrets.FEATURE_TESTING_UI_PASSWORD }} ${{ needs.build.outputs.tag }}
|
|
|
git config --global user.email "kafka-ui-infra@provectus.com"
|
|
|
git config --global user.name "kafka-ui-infra"
|
|
|
git add -A
|