Skip to content

Commit

Permalink
Builds the docker image with the ref provided (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-carey authored Jun 2, 2023
1 parent b58b6fd commit a2446b2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-ecr-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ on:
description: "Build's context is the set of files located in the specified PATH or URL"
required: false
type: string
default: . # uses checkout ref
file:
description: "Path to the Dockerfile"
required: false
Expand Down
32 changes: 27 additions & 5 deletions .github/workflows/test-build-ecr-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ defaults:
shell: bash

jobs:
# Build for Branch
# Build for Branch no ref
run-build-ecr-image-workflow:
uses: ./.github/workflows/build-ecr-image.yml
with:
Expand All @@ -29,7 +29,6 @@ jobs:
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}

test-build-ecr-image-workflow:
name: 'Uses the build-ecr-image workflow'
runs-on: ubuntu-latest
needs: run-build-ecr-image-workflow
steps:
Expand All @@ -42,20 +41,43 @@ jobs:
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}
ref: ${{ github.sha }}

# Build for Branch name
run-build-ecr-image-workflow-on-branch-name:
uses: ./.github/workflows/build-ecr-image.yml
with:
file: .github/actions/test-build-ecr-image/Dockerfile
repository-name: github-actions-tests
role-name: github-actions-tests
build-args: VERSION=${{ github.base_ref }}
ref: ${{ github.base_ref }}
secrets:
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}

# Build for SHA
run-build-ecr-image-workflow-on-github-sha:
uses: ./.github/workflows/build-ecr-image.yml
with:
file: .github/actions/test-build-ecr-image/Dockerfile
repository-name: github-actions-tests
role-name: github-actions-tests
build-args: VERSION=${{ github.sha }}
ref: ${{ github.sha }}
secrets:
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}

# Build for Tag
run-build-ecr-image-workflow-tag:
uses: ./.github/workflows/build-ecr-image.yml
with:
ref: v2.2.0-rc.0
ref: v2.6.4-rc.0
file: .github/actions/test-build-ecr-image/Dockerfile
repository-name: github-actions-tests
role-name: github-actions-tests
build-args: VERSION=v2.2.0-rc.0
build-args: VERSION=v2.6.4-rc.0
secrets:
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}

test-build-ecr-image-workflow-tag:
name: 'Uses the build-ecr-image workflow'
runs-on: ubuntu-latest
needs: run-build-ecr-image-workflow-tag
steps:
Expand Down

0 comments on commit a2446b2

Please sign in to comment.