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
18 changes: 18 additions & 0 deletions .github/workflows/ngwpc-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ jobs:
ngen_forcing_digest: ${{ steps.vars.outputs.ngen_forcing_digest }}
ngen_forcing_revision: ${{ steps.vars.outputs.ngen_forcing_revision }}
ewts_revision: ${{ steps.vars.outputs.ewts_revision }}
ewts_cache_bust: ${{ steps.vars.outputs.ewts_cache_bust }}
steps:
- name: Compute image vars
id: vars
Expand Down Expand Up @@ -171,6 +172,21 @@ jobs:

EWTS_REVISION=$(resolve_sha "https://github.com/${{ inputs.EWTS_ORG || github.repository_owner }}/nwm-ewts.git" "$(ref_or_default "${{ inputs.EWTS_REF }}")")

# Resolve EWTS ref for Docker cache busting
EWTS_ORG="${{ inputs.EWTS_ORG || github.repository_owner }}"
EWTS_REF="${{ inputs.EWTS_REF || 'development' }}"

if [[ "${EWTS_REF}" =~ ^[0-9a-f]{7,40}$ ]]; then
EWTS_CACHE_BUST="${EWTS_REF}"
else
EWTS_CACHE_BUST="$(git ls-remote "https://github.com/${EWTS_ORG}/nwm-ewts.git" "${EWTS_REF}" | awk '{print $1}')"
fi

if [ -z "${EWTS_CACHE_BUST}" ]; then
echo "ERROR: Could not resolve EWTS_REF=${EWTS_REF}"
exit 1
fi

# save outputs
cat >> "$GITHUB_OUTPUT" <<EOF
org=${ORG}
Expand All @@ -184,6 +200,7 @@ jobs:
ngen_forcing_digest=${NGEN_FORCING_DIGEST}
ngen_forcing_revision=${NGEN_FORCING_REVISION}
ewts_revision=${EWTS_REVISION}
ewts_cache_bust=${EWTS_CACHE_BUST}
EOF

# CodeQL scan
Expand Down Expand Up @@ -343,6 +360,7 @@ jobs:
EWTS_ORG=${{ inputs.EWTS_ORG || github.repository_owner }}
EWTS_REF=${{ inputs.EWTS_REF || needs.setup.outputs.default_ref }}
EWTS_REVISION=${{ needs.setup.outputs.ewts_revision }}
EWTS_CACHE_BUST=${{ needs.setup.outputs.ewts_cache_bust }}
IMAGE_SOURCE=https://github.com/${{ github.repository }}
IMAGE_VENDOR=${{ github.repository_owner }}
IMAGE_VERSION=${{ needs.setup.outputs.clean_ref }}
Expand Down
Loading