# GitHub Action CICD

Prerequisite: Attached file, GITRepo.zip should be present in the GitHub repo as shown in the first snapshot

- [GITRepo.zip](../../../Resources/Scripts/GITRepo.zip)
 
The following files are available in the folder. The following information details the configuration changes need to be made.

- Build.xml
- controller.json
- ec2.creds
 
## Build.xml

Build.xml files hold the configuration settings and also all the defined ANT tags.

Some of the ant tags are explained below:

- deps - Downloads the required AppvanceRestClientWithDeps.jar
- startNode - Starts the mentioned EC2 instance using the file ec2.creds and controller.json files which holds details about account and instance details.  
    setupEnvironment - Depending on the parameters, we could use this to set up the environment.
- executeScenario - Executes the mentioned scenarios.
- stopNode - Stops the instance once the execution is done.
- createScenariosDashboard - This tag will create the Scenario Dashboard once execution is complete.
- createScenariosDashboard - This tag will create the Scenario Dashboard once execution is complete.
 
### AISG Related Targets

- blueprintCreation - Starts the creation of the AISG.
- reportUpload - uploads the smoke test report, timing report and a BlueprintReport.html which is a human-readable report.uploads the smoke test report, timing report and a BlueprintReport.html which is a human-readable report.
- blueprintDashboard: this target generates an HTML report that includes the history of all previous build reports and uploads it to an S3 bucket.
- checkResult: this target checks the AISG generated report and it will fail the build if the number of failures surpases a user defined parameter.
- generateRegressionScenario - Generates the Regression scenarios.
 
Details about all the ant targets can be found in [CICD- AntTags.](https://docs.appvance.net/Content/AIQ/Integrations/ContinousIntegration/CICD__AntTags.htm)

## controller.json

Basically has details about the controller machine and the credentials. Above can be used when we have the EC2 set-up.

When we are running AIQ local builds, instances in the 2nd line could be replaced with "url" and full URL of the AIQ controller could be provided.

<div class="codeSnippet" id="bkmrk-copy-%7B%22controller%22%3A-"><div class="codeSnippetBody">```
{<br></br><span style="color:#dd1144;">"controller"</span>: {<br></br><span style="color:#dd1144;">"url"</span>: <span style="color:#dd1144;">"<http://<replace_IP>:8080"</span>,><br></br><span style="color:#dd1144;">"instances"</span>: [<span style="color:#dd1144;">"<replace_instanceID>"</span>],<br></br><span style="color:#dd1144;">"ec2Creds"</span>: <span style="color:#dd1144;">"ec2.creds"</span>,<br></br><span style="color:#dd1144;">"timeOut"</span>: <span style="color:#008080;">180</span>,<br></br><span style="color:#dd1144;">"username"</span>: <span style="color:#dd1144;">"<replace_username>"</span>,<br></br><span style="color:#dd1144;">"password"</span>: <span style="color:#dd1144;">"<replace_password>"</span>,<br></br><span style="color:#dd1144;">"workFolder"</span>: <span style="color:#dd1144;">"<replace_path/to/AIQ/resources>"</span><br></br>}<br></br>}<br></br>
```

 </div> </div>## ec2.creds

ec2.creds will have details of the AWS account: This can be used when we are using AIQ Controller on the EC2 machine and when yours tests are run in the AWS cloud.

AWS\_ACCESS\_KEY\_ID=&lt;replace\_awsKEYIDE&gt;

AWS\_SECRET\_ACCESS\_KEY=&lt;replace\_awsSecretAccessKey&gt;

## Required File Changes

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/486iVn4Wvw1Lxm4Q-7c33dbb05877.png)

Once we login to GitHub click the Actions tabs and click New Workflow

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/YtkIcWLBGjCBzfRV-b9f4f49d3cbb.png)

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/Hn3brP6fR1ddr9EN-2f5495186ef5.png)

Click Simple Workflow by Github and paste the below code into the .yml Text Editor

<div class="codeSnippet" id="bkmrk-copy-name%3A-ci-create"><div class="codeSnippetBody">```
name: CI-Create-Dashboard<br></br><br></br>on:<br></br>  push:<br></br>    branches:<br></br>      - master<br></br>  workflow_dispatch:<br></br><br></br>env:<br></br>  REGISTRY: &lt;name of registry&gt;jobs:<br></br>  lint:<br></br>    runs-on: ubuntu-latest<br></br>    name: Lint Code Base<br></br>    steps:<br></br>      - name: Checkout Code<br></br>        uses: actions/checkout@v3<br></br>        with:<br></br>          fetch-depth: 0<br></br>      - name: Lint Code Base<br></br>        uses: github/super-linter@v4<br></br>        env:<br></br>          VALIDATE_ALL_CODEBASE: false<br></br>          DEFAULT_BRANCH: master<br></br>          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}<br></br><br></br>  build_and_push:<br></br>    runs-on: ubuntu-latest<br></br>    name: Build and push docker image<br></br>    needs: lint<br></br>    outputs:<br></br>      commit_hash: ${{ steps.commit_hash.outputs.commit_hash }}<br></br>    steps:<br></br>      - uses: actions/checkout@v3<br></br>      - name: Set up JDK 11<br></br>        uses: actions/setup-java@v3<br></br>        with: <br></br>          java-version: '11'<br></br>          distribution: 'adopt'<br></br>      - name: Build with Ant<br></br>        run: ant -noinput -buildfile build.xml<br></br><br></br>      - id: commit_hash<br></br>        run: echo "::set-output name=commit_hash::${GITHUB_SHA::7}"      - name: Login to &lt;registry&gt;        uses: docker/login-action@v2<br></br>        with:<br></br>          username: ${{ secrets.DOCKER_USER }}<br></br>          password: ${{ secrets.DOCKER_TOKEN }}<br></br><br></br>      - name: Build and push<br></br>        uses: docker/build-push-action@v3<br></br>        with:<br></br>          context: .<br></br>          push: true<br></br>          tags: |<br></br>            ${{ env.REGISTRY }}:${{ steps.commit_hash.outputs.commit_hash }}
```

 </div> </div><div id="bkmrk-%C2%A0" style="border-width:1px;"><div>```
 
```

```

```

 </div> </div> ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/LSpMMvvTJBc0oYA6-484fb917474d.png)Click Run Workflow

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/qIgGoxZBLZVHTXpL-3fd5f3286ed4.png)<div id="bkmrk-last-updated%3A-july-0">---

Last updated: <span class="mc-variable General.NewDateTimeVariable variable">July 03, 2023</span>

If you have any feedback on this topic, please contact us at <documentation@appvance.ai>

</div>