Skip to content

Action for getting tag for pushing Docker image to ghcr.io

Notifications You must be signed in to change notification settings

Danand/docker-image-tag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

GitHub Actions: Generate Docker Image Tag

How to use

Add to your steps at certain job:

# Add usage of action:
- name: Get Docker image tag for ghcr.io
  id: docker-image-tag
  uses: Danand/docker-image-tag@v1
  with:
    product-name: 'my-app'
    service-suffix: 'api' # Optional.
    input-version: '1.2.3' # Optional. Overrides tag fetched from Git.
- name: Assign tag for Docker image
  shell: bash
  run: docker -t "my-app-api:1.2.3" "${{ steps.docker-image-tag.outputs.image-tag }}"

Expected output of ${{ steps.docker-image-tag.outputs.image-tag }}:

ghcr.io/my-user-name/my-repo/my-app-api-1.2.3