[NM-82] download results state refactor #323
This file contains 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
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}} |