diff --git a/action.yaml b/action.yaml index a101510..c95f922 100644 --- a/action.yaml +++ b/action.yaml @@ -11,7 +11,9 @@ inputs: folder: description: 'The folder for the component' required: true - stage: + dockerfile: + description: 'Optional name for the Dockerfile to use' + prefix: description: 'Optional prefix to add to the built image tags' project: description: 'Project name for the Diploi Docker registry' @@ -40,7 +42,7 @@ runs: uses: docker/metadata-action@v4 with: images: ${{ env.registry }}/${{ env.project }}/${{ inputs.identifier }} - flavor: suffix=${{ inputs.stage }} + tags: ${{ inputs.prefix && 'type=ref,event=branch\ntype=ref,event=branch,prefix=${{ inputs.prefix }}-' || 'type=ref,event=branch' }} - name: 'Log in to the Diploi Container Registry' uses: docker/login-action@v2 @@ -53,7 +55,7 @@ runs: uses: docker/build-push-action@v6 with: context: ${{ inputs.folder }} - file: ${{ inputs.folder }}/Dockerfile${{ inputs.stage && format('.{0}', inputs.stage) || '' }} + file: ${{ inputs.folder }}/${{ inputs.dockerfile || 'Dockerfile' }} pull: true push: ${{ github.event_name != 'pull_request' }} platforms: linux/arm64