diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8779614..ee21e5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,12 +89,12 @@ jobs: - name: Decide image tag name id: determine env: - git_tag: ${{ steps.git_info.outputs.tag }} + git_tag: ${{ steps.git_info.outputs.tag }} run: | - repo="${GITHUB_REPOSITORY,,}" # to lower case - # if build triggered by tag, use tag name - tag="${git_tag:-latest}" - dock_image=$repo:$tag + repo="${GITHUB_REPOSITORY,,}" # to lower case + # if build triggered by tag, use tag name + tag="${git_tag:-latest}" + dock_image=$repo:$tag echo $dock_image echo "dock_image=$dock_image" >> $GITHUB_OUTPUT echo "repo=$repo" >> $GITHUB_OUTPUT @@ -126,54 +126,54 @@ jobs: - name: Login to GitHub Container Registry uses: docker/login-action@v1 with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v2 id: docker_build with: - context: . - file: ./Dockerfile - tags: | - ${{ steps.determine.outputs.dock_image }} - localhost:5000/${{ steps.determine.outputs.dock_image }} - ghcr.io/${{ steps.determine.outputs.dock_image }} - platforms: linux/amd64 - push: true - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + context: . + file: ./Dockerfile + tags: | + ${{ steps.determine.outputs.dock_image }} + localhost:5000/${{ steps.determine.outputs.dock_image }} + ghcr.io/${{ steps.determine.outputs.dock_image }} + platforms: linux/amd64 + push: true + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache - name: Get plugin meta id: pluginmeta run: | - repo=${{ steps.determine.outputs.repo }} - dock_image=${{ steps.determine.outputs.dock_image }} - docker pull localhost:5000/$dock_image - docker tag localhost:5000/$dock_image $dock_image - script=$(docker inspect --format '{{ (index .Config.Cmd 0) }}' $dock_image) - docker run --rm $dock_image $script --json \ - | jq '. += {"name":"pl-lld_inference", "dock_image": "'$dock_image'", "public_repo": "'${{ github.server_url }}/${{ github.repository }}'" }' \ - > /tmp/description.json + repo=${{ steps.determine.outputs.repo }} + dock_image=${{ steps.determine.outputs.dock_image }} + docker pull localhost:5000/$dock_image + docker tag localhost:5000/$dock_image $dock_image + script=$(docker inspect --format '{{ (index .Config.Cmd 0) }}' $dock_image) + docker run --rm $dock_image $script --json \ + | jq '. += {"name":"pl-lld_inference", "dock_image": "'$dock_image'", "public_repo": "'${{ github.server_url }}/${{ github.repository }}'" }' \ + > /tmp/description.json - name: Update DockerHub description uses: peter-evans/dockerhub-description@v2 continue-on-error: true # it is not crucial that this works with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - short-description: ${{ steps.pluginmeta.outputs.title }} - readme-filepath: ./README.rst - repository: ${{ steps.determine.outputs.repo }} + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + short-description: ${{ steps.pluginmeta.outputs.title }} + readme-filepath: ./README.rst + repository: ${{ steps.determine.outputs.repo }} - name: Upload ChRIS Plugin id: upload if: github.ref_type == 'tag' uses: FNNDSC/upload-chris-plugin@main with: - description_file: /tmp/description.json - username: ${{ secrets.CHRISPROJECT_USERNAME }} - password: ${{ secrets.CHRISPROJECT_PASSWORD }} - chris_url: https://cube.chrisproject.org/api/v1/ - compute_names: NERC \ No newline at end of file + description_file: /tmp/description.json + username: ${{ secrets.CHRISPROJECT_USERNAME }} + password: ${{ secrets.CHRISPROJECT_PASSWORD }} + chris_url: https://cube.chrisproject.org/api/v1/ + compute_names: NERC \ No newline at end of file