Closed iaingalloway closed 1 year ago
- name: Determine image tags using Docker metadata action
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,value=latest,enable=${{ startsWith(github.ref, github.event.repository.default_branch) }}
type=ref,event=branch
type=ref,event=pr
type=raw,value=${{ steps.gitversion.outputs.semVer }},enable=${{ startsWith(github.ref, github.event.repository.default_branch) }}
type=raw,value=${{ steps.gitversion.outputs.major }}.${{ steps.gitversion.outputs.minor }},enable=${{ startsWith(github.ref, github.event.repository.default_branch) }}
type=raw,value=${{ steps.gitversion.outputs.major }},enable=${{ steps.gitversion.outputs.major != '0' }},enable=${{ startsWith(github.ref, github.event.repository.default_branch) }}
type=raw,value=${{ steps.gitversion.outputs.semVer }}.${{ steps.gitversion.outputs.branchName }}-${{ steps.gitversion.outputs.commitsSinceVersionSource }}-{{sha}}
type=raw,value=${{ steps.gitversion.outputs.semVer }}.${{ steps.gitversion.outputs.branchName }}-${{ steps.gitversion.outputs.commitsSinceVersionSource }}-${{ steps.gitversion.outputs.sha }}
type=raw,value=${{ steps.gitversion.outputs.major }}.${{ steps.gitversion.outputs.minor }}-${{ steps.component-name.outputs.name }}${{ steps.component-version.outputs.version }},enable=${{ startsWith(github.ref, github.event.repository.default_branch) && steps.component-version.outputs.version-found == 'true' }}
type=raw,value=${{ steps.gitversion.outputs.major }},enable=${{ steps.gitversion.outputs.major != '0' }}-${{ steps.component-name.outputs.name }}${{ steps.component-version.outputs.version }},enable=${{ startsWith(github.ref, github.event.repository.default_branch) && steps.component-version.outputs.version-found == 'true' }}
type=raw,value=${{ steps.gitversion.outputs.semVer }}.${{ steps.gitversion.outputs.branchName }}-${{ steps.gitversion.outputs.commitsSinceVersionSource }}-{{sha}}-${{ steps.component-name.outputs.name }}${{ steps.component-version.outputs.version }},enable=${{ steps.component-version.outputs.version-found == 'true' }}
type=raw,value=${{ steps.gitversion.outputs.semVer }}.${{ steps.gitversion.outputs.branchName }}-${{ steps.gitversion.outputs.commitsSinceVersionSource }}-${{ steps.gitversion.outputs.sha }}-${{ steps.component-name.outputs.name }}${{ steps.component-version.outputs.version }},enable=${{ steps.component-version.outputs.version-found == 'true' }}
- name: Build devcontainer
uses: devcontainers/ci@v0.3
with:
imageName: ${{ inputs.registry }}/${{ github.repository }}/${{ inputs.image }}
imageTag: ${{ join(fromJson(steps.meta.outputs.json).tags, ',') }}
subFolder: ./src/devcontainers/${{ inputs.image }}
cacheFrom: ${{ inputs.registry }}/${{ github.repository }}/${{ inputs.image }}
On complicating factor is that the docker metadata action appears to split out tags separated by newlines
https://github.com/iaingalloway/gitversion-prototype/actions/runs/6677007276/job/18146608120
and