Update github/codeql-action requirement to 4c3e5362829f0b0bb62ff5f6c938d7f95574c306 #2800
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Infra: Feature Testing: Init env" | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| types: ['labeled'] | |
| permissions: | |
| contents: read | |
| statuses: write | |
| jobs: | |
| build: | |
| if: ${{ github.event.label.name == 'status/feature_testing' || github.event.label.name == 'status/feature_testing_public' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # infered from @v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| token: ${{ github.token }} | |
| - name: get branch name | |
| id: extract_branch | |
| run: | | |
| tag='pr${{ github.event.pull_request.number }}' | |
| echo "tag=${tag}" >> $GITHUB_OUTPUT | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up JDK | |
| uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # infered from @v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'zulu' | |
| cache: 'gradle' | |
| - 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@29109295f81e9208d7d86ff1c6c12d2833863392 # infered from @v3 | |
| - name: Set up Docker Buildx | |
| id: buildx | |
| uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # infered from @v3 | |
| - name: Cache Docker layers | |
| uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # infered from @v4 | |
| 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@e3dd6a429d7300a6a4c196c26e071d42e0343502 # infered from @v4 | |
| 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@9238dd443b7a5941caf19ffbe68be34d4dbd61df # infered from @v4 | |
| - name: Build and push | |
| id: docker_build_and_push | |
| uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # infered from @v6 | |
| with: | |
| builder: ${{ steps.buildx.outputs.name }} | |
| context: api | |
| push: true | |
| tags: 297478128798.dkr.ecr.eu-central-1.amazonaws.com/kafka-ui:${{ steps.extract_branch.outputs.tag }} | |
| build-args: | | |
| JAR_FILE=build/libs/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 }} | |
| make-branch-env: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: clone | |
| run: | | |
| git clone https://infra-tech:${{ secrets.INFRA_USER_ACCESS_TOKEN }}@github.com/kafbat/kafka-ui-infra.git --branch envs | |
| - name: create deployment | |
| run: | | |
| cd kafka-ui-infra/aws-infrastructure4eks/argocd/scripts | |
| echo "Branch:${{ needs.build.outputs.tag }}" | |
| ./kafka-ui-deployment-from-branch.sh ${{ needs.build.outputs.tag }} ${{ github.event.label.name }} ${{ secrets.FEATURE_TESTING_UI_PASSWORD }} | |
| git config --global user.email "[email protected]" | |
| git config --global user.name "infra-tech" | |
| git add ../kafka-ui-from-branch/ | |
| git commit -m "added env:${{ needs.build.outputs.deploy }}" && git push || true | |
| - name: update status check for private deployment | |
| if: ${{ github.event.label.name == 'status/feature_testing' }} | |
| uses: Sibz/github-status-action@650dd1a882a76dbbbc4576fb5974b8d22f29847f # infered from @v1.1.6 | |
| with: | |
| authToken: ${{secrets.GITHUB_TOKEN}} | |
| context: "Click Details button to open custom deployment page" | |
| state: "success" | |
| sha: ${{ github.event.pull_request.head.sha || github.sha }} | |
| target_url: "http://${{ needs.build.outputs.tag }}.internal.ui.kafbat.dev" | |
| - name: update status check for public deployment | |
| if: ${{ github.event.label.name == 'status/feature_testing_public' }} | |
| uses: Sibz/github-status-action@650dd1a882a76dbbbc4576fb5974b8d22f29847f # infered from @v1.1.6 | |
| with: | |
| authToken: ${{secrets.GITHUB_TOKEN}} | |
| context: "Click Details button to open custom deployment page" | |
| state: "success" | |
| sha: ${{ github.event.pull_request.head.sha || github.sha }} | |
| target_url: "http://${{ needs.build.outputs.tag }}.internal.ui.kafbat.dev" |