Skip to content

Merge pull request #1041 from hivtools/nm-62 #370

Merge pull request #1041 from hivtools/nm-62

Merge pull request #1041 from hivtools/nm-62 #370

on:
push:
branches:
- main
pull_request:
branches:
- "*"
name: Build and Push CLI
env:
TAG_DH: mrcide/hint-user-cli
TAG_GHCR: hivtools/hint-user-cli
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Make shared env
id: ci-env
uses: ./.github/actions/make-shared-env
with:
dh-username: ${{ secrets.DOCKERHUB_USERNAME }}
dh-password: ${{ secrets.DOCKERHUB_TOKEN }}
ghcr-username: ${{ github.actor }}
ghcr-password: ${{ secrets.GITHUB_TOKEN }}
- name: Run deps
run: scripts/run-dependencies.sh
- name: Test CLI
run: src/gradlew -p src :userCLI:test -x app:compileFrontEnd -x app:copyAssets
- name: Build docker image
run: |
rm -f /etc/hint/config.properties
src/gradlew -p src :userCLI:docker -i -Pdocker_version=$CI_SHA -x app:compileFrontEnd -x app:copyAssets
env:
CI_SHA: ${{steps.ci-env.outputs.CI_SHA}}
- name: Push image
run: |
docker tag "$TAG_DH_SHA" "$TAG_DH_BRANCH"
docker tag "$TAG_DH_SHA" "$TAG_GHCR_SHA"
docker tag "$TAG_DH_SHA" "$TAG_GHCR_BRANCH"
docker push "$TAG_DH_SHA"
docker push "$TAG_DH_BRANCH"
docker push "$TAG_GHCR_SHA"
docker push "$TAG_GHCR_BRANCH"
env:
TAG_DH_SHA: ${{env.TAG_DH}}:${{steps.ci-env.outputs.CI_SHA}}
TAG_DH_BRANCH: ${{env.TAG_DH}}:${{steps.ci-env.outputs.CI_BRANCH}}
TAG_GHCR_SHA: ghcr.io/${{env.TAG_GHCR}}:${{steps.ci-env.outputs.CI_SHA}}
TAG_GHCR_BRANCH: ghcr.io/${{env.TAG_GHCR}}:${{steps.ci-env.outputs.CI_BRANCH}}