зеркало из https://github.com/mozilla/fxa.git
fix(docker): Use git tag from lookup
The `GITHUB_REF_NAME` variable only works for tags pushed by developers. When calling the docker.yml workflow from tag-release.yml, the contents of `GITHUB_REF_NAME` is `main`, the branch that the GitHub Action is running on. This will fix the version output for x.y.0 tags created by tag-release.yml.
This commit is contained in:
Родитель
496ecb05e4
Коммит
1748d4579a
|
@ -49,13 +49,13 @@ jobs:
|
||||||
GCP_PROJECT_ID: moz-fx-fxa-prod
|
GCP_PROJECT_ID: moz-fx-fxa-prod
|
||||||
IMAGE: fxa-mono
|
IMAGE: fxa-mono
|
||||||
RUN_ID: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
RUN_ID: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||||
TAG: ${{ needs.tag.outputs.TAG }}
|
GIT_TAG: ${{ needs.tag.outputs.TAG }}
|
||||||
needs:
|
needs:
|
||||||
- tag
|
- tag
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: ${{ env.TAG }}
|
ref: ${{ env.GIT_TAG }}
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
|
@ -87,7 +87,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: _dev/docker/mono/Dockerfile
|
file: _dev/docker/mono/Dockerfile
|
||||||
tags: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/${{ env.GAR_REPOSITORY}}/${{ env.IMAGE}}:${{ env.TAG }}
|
tags: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/${{ env.GAR_REPOSITORY}}/${{ env.IMAGE}}:${{ env.GIT_TAG }}
|
||||||
push: true
|
push: true
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
|
@ -13,7 +13,7 @@ if [[ "${CIRCLECI}" == "true" ]]; then
|
||||||
elif [[ "${GITHUB_ACTIONS}" == "true" ]]; then
|
elif [[ "${GITHUB_ACTIONS}" == "true" ]]; then
|
||||||
printf '{"version":{"hash":"%s","version":"%s","source":"https://github.com/%s","build":"%s/%s/actions/runs/%s"}}\n' \
|
printf '{"version":{"hash":"%s","version":"%s","source":"https://github.com/%s","build":"%s/%s/actions/runs/%s"}}\n' \
|
||||||
"${GITHUB_SHA}" \
|
"${GITHUB_SHA}" \
|
||||||
"${GITHUB_REF_NAME}" \
|
"${GIT_TAG}" \
|
||||||
"${GITHUB_REPOSITORY}" \
|
"${GITHUB_REPOSITORY}" \
|
||||||
"${GITHUB_SERVER_URL}" \
|
"${GITHUB_SERVER_URL}" \
|
||||||
"${GITHUB_REPOSITORY}" \
|
"${GITHUB_REPOSITORY}" \
|
||||||
|
|
Загрузка…
Ссылка в новой задаче