Skip to content
Merged
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
15 changes: 9 additions & 6 deletions .github/workflows/__call-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,24 +161,27 @@ jobs:
BRANCH: ${{ github.ref }}
COMMIT: ${{ inputs.release_commit }}
NEW_TAG: ${{ inputs.release_tag }}
GH_EVENT_REPOSITORY_CLONE_URL: ${{ github.event.repository.clone_url }}
shell: bash
run: |
# get variables
branch="${BRANCH:-master}"
commit="${COMMIT:-${{ github.sha }}}"
clone_url="${{ github.event.repository.clone_url }}"
commit="${COMMIT:-${GITHUB_SHA}}"
clone_url="${GH_EVENT_REPOSITORY_CLONE_URL}"

if [ "${{ github.event_name }}" == "push" ]; then
push=false
if [ "${GITHUB_EVENT_NAME}" == "push" ]; then
echo "This is a PUSH event"
branch="${{ github.ref_name }}"
branch="${GITHUB_REF_NAME}"
push=true
fi

# setup the tags
BASE_TAG="${{ needs.check_dockerfiles.outputs.base_tag }}"

TAGS="${BASE_TAG}:${commit:0:7}${{ matrix.tag }},ghcr.io/${BASE_TAG}:${commit:0:7}${{ matrix.tag }}"

if [[ "${branch}" == refs/heads/master ]]; then
if [[ "${push}" == true ]]; then
TAGS="${TAGS},${BASE_TAG}:latest${{ matrix.tag }},ghcr.io/${BASE_TAG}:latest${{ matrix.tag }}"
TAGS="${TAGS},${BASE_TAG}:master${{ matrix.tag }},ghcr.io/${BASE_TAG}:master${{ matrix.tag }}"
else
Expand All @@ -192,7 +195,7 @@ jobs:
# parse custom directives out of dockerfile
# try to get the platforms from the dockerfile custom directive, i.e. `# platforms: xxx,yyy`
# directives for PR event, i.e. not push event
if [ "${{ github.event_name }}" == "pull_request" ]; then
if [ "${GITHUB_EVENT_NAME}" == "pull_request" ]; then
while read -r line; do
if [[ $line == "# platforms_pr: "* && $PLATFORMS == "" ]]; then
# echo the line and use `sed` to remove the custom directive
Expand Down