Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 8 additions & 20 deletions .github/workflows/digabi-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,41 +82,29 @@ jobs:
uses: docker/setup-buildx-action@v3
- id: docker-tags
uses: digabi/workflows-common/actions/get-image-tags@main
- name: Build and push to Amazon ECR
if: ${{ !startsWith(steps.docker-tags.outputs.image_tag, 'dependabot') }}
uses: docker/build-push-action@v5
with:
push: true
file: ${{ inputs.file }}
context: ${{ inputs.context }}
tags: ${{ steps.login-ecr.outputs.registry }}/${{ inputs.image-name }}:${{ steps.docker-tags.outputs.image_tag }}
provenance: false
target: ${{ inputs.docker-target }}
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
secrets: |
npmrc=//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
- name: Log in to the GitHub Container registry
if: ${{ inputs.tag-latest}}
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push latest tag to GitHub Container Registry
if: ${{ inputs.tag-latest }}
- name: Build and push image
if: ${{ !startsWith(steps.docker-tags.outputs.image_tag, 'dependabot') }}
uses: docker/build-push-action@v5
with:
push: true
file: ${{ inputs.file }}
context: ${{ inputs.context }}
tags: ghcr.io/digabi/${{ inputs.image-name }}:${{ steps.docker-tags.outputs.image_tag_latest }}
provenance: false
target: ${{ inputs.docker-target }}
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
pull: true
tags: |
${{ steps.login-ecr.outputs.registry }}/${{ inputs.image-name }}:${{ steps.docker-tags.outputs.image_tag }}
${{ inputs.tag-latest && format('ghcr.io/digabi/{0}:{1}', inputs.image-name, steps.docker-tags.outputs.image_tag_latest) || '' }}
cache-from: type=gha,scope=${{ github.repository }}-${{ inputs.image-name }}
cache-to: type=gha,scope=${{ github.repository }}-${{ inputs.image-name }},mode=max
secrets: |
npmrc=//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
- name: Delete orphaned images from Github Container Registry
Expand Down