# GitHub Action

[https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-ant](https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-ant)

You must be authorized on GitHub with the public key.

Create a new repository.

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/fsotpHXhOIbMg8Yw-70d5dbf0a61e.png) ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/UtIkyYAVKehAmyPY-3f26225f8de7.png) ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/m6PKQLWkdkdFTLwW-058bb8c5955b.png) ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/GzAOCbmRtTEMf2gX-92ca536c8af4.png)Clone repo.

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/3fPrIAKZm0BWO0QH-174319c01be5.png)Open the terminal on his machine.

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/NaCwOND2i3wB4ZFo-3f54657912db.png) ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/zJeFdIJ9xYs8WICF-7790c1e2c8b3.png) ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/5ZHgDIMzPN5YraDl-69a0f25b740b.png) ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/1JsHmknqbxyLlJHl-f6772d9499ba.png)Change directory.

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/xkHvQI2KE9A8hKCp-ad226c4f402f.png) ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/rv5zTYl6RamYwHaF-727444dcf62c.png)Create files or paste some code into the repo

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/6mtUzoY5iS6jO3FV-30e30ac324e8.png)<div id="bkmrk-name%3A-ci-create-dash"> <table> <colgroup> <col style="width: 680.0px;"></col> </colgroup> <tbody> <tr> <td><div style="border-width: 1px;"><div>```
name: CI-Create-Dashboard
on:
  push:
    branches:
      - master
  workflow_dispatch:
env:
  REGISTRY: <name of registry>jobs:
  lint:
    runs-on: ubuntu-latest
    name: Lint Code Base
    steps:
      - name: Checkout Code
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: Lint Code Base
        uses: github/super-linter@v4
        env:
          VALIDATE_ALL_CODEBASE: false
          DEFAULT_BRANCH: master
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  build_and_push:
    runs-on: ubuntu-latest
    name: Build and push docker image
    needs: lint
    outputs:
      commit_hash: ${{ steps.commit_hash.outputs.commit_hash }}
    steps:
      - uses: actions/checkout@v3
      - name: Set up JDK 11
        uses: actions/setup-java@v3
        with: 
          java-version: '11'
          distribution: 'adopt'
      - name: Build with Ant
        run: ant -noinput -buildfile build.xml
      - id: commit_hash
        run: echo "::set-output name=commit_hash::${GITHUB_SHA::7}"      - name: Login to <registry>        uses: docker/login-action@v2
        with:
          username: ${{ secrets.DOCKER_USER }}
          password: ${{ secrets.DOCKER_TOKEN }}
      - name: Build and push
        uses: docker/build-push-action@v3
        with:
          context: .
          push: true
          tags: |
            ${{ env.REGISTRY }}:${{ steps.commit_hash.outputs.commit_hash }}
```

 </div> </div> </td> </tr> </tbody> </table>

 </div>Copy code from above example main.yml and paste into, or use example from GitHub

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/10fCw4FGUCB0CHi2-5d95ee7c79d1.png) ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/DkGrrK8rOdR7udoQ-f2c23206138f.png) ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/xNyXRj8d1q6sqE3p-df96afca3774.png) ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/MSu5Rr5XGXtqncmx-af13a1908168.png)GitHub created directory for you [.github](https://github.com/nikolasht1/new-repository/tree/main/.github)/**workflows**/

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/LO7YvjrgWZuaVZUi-284a208732e9.png) ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/SfMih5EtWZvL0hNp-8484260515e1.png) ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/aHzxNMAaNQsOsSEp-0821995689ef.png) ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/DD62TnXfw4h2uJad-70a030484d95.png) ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/HLrmbJiMK5tyLfW2-675a30ef3c3e.png) ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/c2VJOWVuFalWDxpv-0d69e0d6c84d.png)For more information visit [https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-ant](https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-ant)

<div id="bkmrk-last-updated%3A-june-2">---

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

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

</div>