Skip to content

Commit

Permalink
Add optional ref parameter to cicd-docker-build-and-distribute wo…
Browse files Browse the repository at this point in the history
…rkflow.
  • Loading branch information
s3rj1k committed Jun 25, 2024
1 parent 10ccf01 commit 09d86fd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/actions/docker-build-artifacts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ runs:
--secret id=DEPLOYMENT_TOKEN,env=DEPLOYMENT_TOKEN \
--tag artifacts-${GITHUB_RUN_ID}:${GITHUB_SHA} \
--ulimit nofile=1024000:1024000 \
--force-rm \
--pull \
. 2>&1 | tee -a ${{ inputs.BUILD_LOG_FILENAME }}
- name: Extract artifacts from image
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/cicd-docker-build-and-distribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Build and Distribute (via Docker)
on:
workflow_call:
inputs:
REF:
required: false
description: The branch, tag or SHA to checkout
type: string
ENVIRONMENT:
required: false
type: string
Expand Down Expand Up @@ -104,10 +108,18 @@ jobs:
id-token: write
environment: ${{ inputs.ENVIRONMENT }}
steps:

- name: Checkout code
if: ${{ inputs.REF == '' }}
uses: actions/checkout@v4
with:
fetch-depth: 0
path: ${{ inputs.CODE_WORKING_DIRECTORY }}

- name: Checkout code by REF
if: ${{ inputs.REF != '' }}
uses: actions/checkout@v4
with:
ref: ${{ inputs.REF }}
fetch-depth: 0
path: ${{ inputs.CODE_WORKING_DIRECTORY }}

Expand Down

0 comments on commit 09d86fd

Please sign in to comment.