Skip to content

Commit

Permalink
Reference commit SHA via env var (#201)
Browse files Browse the repository at this point in the history
* Modularize Github Action usage with shared workflows.

* Prefix shared workflows with "_", since we can't have subdirectories in .github/workflows

* Remove shared _setup.yml workflow and duplicate its steps in the terraform and validate workflows (we can't reused the outputs across jobs)

* Reference commit SHA via env var
  • Loading branch information
danielnaab authored Jun 18, 2024
1 parent fd6941b commit 1e5c09a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/_build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ env:
TAG_NAME: ${{ github.ref_name }}
APP_DIR: ${{ inputs.app-name }}
REGISTRY_PATH: ghcr.io/${{ inputs.repo-name }}/${{ inputs.app-name }}
COMMIT_SHA: ${{github.sha}}

jobs:
setup:
Expand All @@ -25,7 +26,7 @@ jobs:

- name: Build Docker image
run: |
docker build . --platform linux/amd64 --target app --build-arg APP_DIR=${APP_DIR} --tag ${REGISTRY_PATH}:${github.sha}
docker build . --platform linux/amd64 --target app --build-arg APP_DIR=${APP_DIR} --tag ${REGISTRY_PATH}:${COMMIT_SHA}
- name: Tag Docker image
run: |
Expand Down

0 comments on commit 1e5c09a

Please sign in to comment.