adamghill / build-docker-and-deploy-to-caprover

MIT License
4 stars 1 forks source link

sorry for the last PR #7

Closed Tobi-De closed 8 months ago

Tobi-De commented 8 months ago

I noticed that you are already addressing the issue, sorry for this :( I was trying the same thing just now

  steps:
    - name: Set default image-name if not provided
      id: set-image-name
      run: |
        slugify() {
        echo "$1" | sed -e 's/[^[:alnum:]]/-/g' | tr -s '-' | tr A-Z a-z
        }

        if [ -z "${{ inputs.image-name }}" ]; then
          IMAGE_NAME=$(slugify ${{ github.repository }})-$(slugify ${{ inputs.caprover-app-name }})
          echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV
        else
          echo "IMAGE_NAME=${{ inputs.image-name }}" >> $GITHUB_ENV
        fi

      shell: bash

By the way, github.repository should be sufficient for the image-name, as it already includes the GitHub username and the name of the repository itself. Adding the CapRover app name might be redundant, since it is likely to be the same as the repository name, which I assume would be the case for most people.

adamghill commented 7 months ago

No worries! We got all of it working eventually!