Skip to content

Commit

Permalink
Build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Slavko Rihtaric committed May 23, 2024
1 parent f8741b2 commit 172170e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 57 deletions.
54 changes: 1 addition & 53 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,5 @@
name: Build and push image
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag name'
required: true
type: string
dockerfile:
description: 'Path to the Dockerfile'
required: false
type: string
default: './Dockerfile'
build_args:
description: 'Docker build arguments'
required: false
type: string
default: ''
artifacts_download:
description: 'Should download artifacts?'
required: false
type: boolean
default: false
artifacts_download_name:
description: 'Artifacts name to download'
required: false
type: string
default: ''
artifacts_download_path:
description: 'Artifacts path to download'
required: false
type: string
default: ''
skip_build:
description: 'List of platforms to skip build'
required: false
type: string
default: ''
tag_check_regex:
description: 'Regex to check tag'
required: false
type: string
default: '^([0-9]+)\.([0-9]+)\.([0-9]+)(-([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?(\\+([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?$'
extract_semver_from_tag:
description: 'Extract semver from tag'
required: false
type: boolean
default: false
tag_extract_regex:
description: 'Regex to extract semver from tag'
required: false
type: string
default: '([^@]+)$'
workflow_call:
inputs:
tag:
Expand Down Expand Up @@ -113,7 +62,6 @@ jobs:
extract_semver_from_tag: ${{ inputs.extract_semver_from_tag }}
tag_extract_regex: ${{ inputs.tag_extract_regex }}


# Build image for each platform
build:
name: Build ${{ needs.tag_check.outputs.semver }}-${{ matrix.platform }}
Expand Down Expand Up @@ -256,7 +204,7 @@ jobs:
# Build and push manifest
manifest:
uses: databox/.github/.github/workflows/manifest.yml@master
uses: databox/.github/.github/workflows/manifest.yml@tag_check
secrets: inherit
needs:
- tag_check
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ jobs:
}
const tags = tagsString.split(' ').filter(tag => tag.trim() !== '');
const result = tags.map(tag => ` --amend $IMAGE:${tag}`).join(' \\\n');
const result = tags.map(tag => ` --amend ${{ inputs.ecr_repository }}:${tag}`).join(' \\\n');
return result.trim();
- name: Build and push manifest
run: |
IMAGE="${{ inputs.ecr_repository }}"
docker manifest create $IMAGE:${{ inputs.tag }} \
IMAGE="${{ inputs.ecr_repository }}:${{ inputs.tag }}"
docker manifest create $IMAGE \
${{ steps.docker-additional-tags.outputs.result }}
docker manifest push $IMAGE:${{ inputs.tag }}
docker manifest push $IMAGE

0 comments on commit 172170e

Please sign in to comment.