Skip to content

Commit 7548cde

Browse files
committed
feat(typescript-node): updates release/nightly workflow
1 parent 1456f5a commit 7548cde

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

.github/workflows/typescript-node-nightly.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
permissions:
1515
contents: read
1616
packages: write
17+
env:
18+
REPO: typescript-node
1719
steps:
1820
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # 6.0.1
1921

@@ -56,13 +58,13 @@ jobs:
5658
push: false
5759
load: true
5860
tags: |
59-
${{ vars.DOCKERHUB_USERNAME }}/typescript-node:${{ steps.tag_builder.outputs.test_tag }}
61+
${{ vars.DOCKERHUB_USERNAME }}/${{ env.REPO }}:${{ steps.tag_builder.outputs.test_tag }}
6062
cache-from: type=gha
6163
cache-to: type=gha,mode=max
6264

6365
- name: Run test
6466
run: |
65-
TEST_IMAGE="${{ vars.DOCKERHUB_USERNAME }}/typescript-node:${{ steps.tag_builder.outputs.test_tag }}"
67+
TEST_IMAGE="${{ vars.DOCKERHUB_USERNAME }}/${{ env.REPO }}:${{ steps.tag_builder.outputs.test_tag }}"
6668
echo "Running smoke test against $TEST_IMAGE"
6769
docker run --rm "$TEST_IMAGE" node -v
6870
@@ -73,7 +75,7 @@ jobs:
7375
platforms: linux/amd64,linux/arm64
7476
push: true
7577
tags: |
76-
${{ vars.DOCKERHUB_USERNAME }}/typescript-node:${{ steps.tag_builder.outputs.build_tag }}
77-
ghcr.io/${{ github.repository_owner }}/typescript-node:${{ steps.tag_builder.outputs.build_tag }}
78+
${{ vars.DOCKERHUB_USERNAME }}/${{ env.REPO }}:${{ steps.tag_builder.outputs.build_tag }}
79+
ghcr.io/${{ github.repository_owner }}/${{ env.REPO }}:${{ steps.tag_builder.outputs.build_tag }}
7880
cache-from: type=gha
7981
cache-to: type=gha,mode=max

.github/workflows/typescript-node-release.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,9 @@ jobs:
8383
- id: image_reference_builder
8484
name: Generate image references
8585
env:
86-
DOCKERHUB_USERNAME: ${{ vars.DOCKERHUB_USERNAME }}
87-
REPO_OWNER: ${{ github.repository_owner }}
86+
NEW_TAG: ${{ steps.tag_builder.outputs.build_tag }}
8887
run: |
89-
NEW_TAG="${{ steps.tag_builder.outputs.build_tag }}"
90-
NEW_MAJOR=$(echo "$NEW_TAG" | cut -d. -f1)
88+
NEW_MAJOR=$(echo "${{ env.NEW_TAG }}" | cut -d. -f1)
9189
REPO="$GITHUB_REPOSITORY"
9290
9391
LATEST_TAG_NAME=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${REPO}/releases/latest" | python -c 'import sys,json;print(json.load(sys.stdin).get("tag_name","") or "")')
@@ -100,10 +98,10 @@ jobs:
10098
10199
echo "New major: $NEW_MAJOR, Latest major: $LATEST_MAJOR"
102100
103-
REFS="${DOCKERHUB_USERNAME}/${REPO}:${NEW_TAG}\nghcr.io/${REPO_OWNER}/${REPO}:${NEW_TAG}"
101+
REFS="${{ vars.DOCKERHUB_USERNAME }}/${{ env.REPO }}:${{ env.NEW_TAG }}\nghcr.io/${{ github.repository_owner }}/${{ env.REPO }}:${{ env.NEW_TAG }}"
104102
if [ "$NEW_MAJOR" -gt "$LATEST_MAJOR" ]; then
105103
echo "Tagging as latest (major increased)"
106-
REFS="${REFS}\n${DOCKERHUB_USERNAME}/${REPO}:latest\nghcr.io/${REPO_OWNER}/${REPO}:latest"
104+
REFS="${REFS}\n${{ vars.DOCKERHUB_USERNAME }}/${{ env.REPO }}:latest\nghcr.io/${{ github.repository_owner }}/${{ env.REPO }}:latest"
107105
else
108106
echo "Not tagging as latest (major not increased)"
109107
fi

0 commit comments

Comments
 (0)