File tree Expand file tree Collapse file tree
.github/actions/netlify-deploy Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ outputs:
1919 netlify_url :
2020 description : The deployed URL
2121 value : ${{ steps.deploy.outputs.netlify_url }}
22+ unique_deploy_url :
23+ description : The unique hash-based deployment URL for this specific build
24+ value : ${{ steps.deploy.outputs.unique_deploy_url }}
2225
2326runs :
2427 using : composite
3235 NETLIFY_AUTH_TOKEN : ${{ inputs.auth-token }}
3336 NETLIFY_SITE_ID : ${{ inputs.site-id }}
3437 run : |
38+ # Execute the deployment
3539 if [ -n "$ALIAS" ]; then
3640 npx -y netlify-cli deploy --dir="$DIR" --alias "$ALIAS" --json > deploy_output.json
3741 else
3842 npx -y netlify-cli deploy --dir="$DIR" --prod --json > deploy_output.json
3943 fi
40- echo "netlify_url=$(jq -r '.url // .deploy_url' deploy_output.json)" >> "$GITHUB_OUTPUT"
44+
45+ # Collect the urls from the deployment output
46+ NETLIFY_URL=$(jq -r '.url // .deploy_url' deploy_output.json)
47+ SITE_NAME=$(jq -r '.site_name' deploy_output.json)
48+ DEPLOY_ID=$(jq -r '.deploy_id' deploy_output.json)
49+ UNIQUE_URL="https://${DEPLOY_ID}--${SITE_NAME}.netlify.app"
50+
51+ echo "netlify_url=$NETLIFY_URL" >> "$GITHUB_OUTPUT"
52+ echo "unique_deploy_url=$UNIQUE_URL" >> "$GITHUB_OUTPUT"
You can’t perform that action at this time.
0 commit comments