ci: extract cf pages deployment url to top level env var

This commit is contained in:
Fernando Fernández 2024-10-03 07:11:40 +00:00 committed by GitHub
parent d0be419ec8
commit 57607f1adc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,6 +24,8 @@ on:
type: string
default: "CFPages-deployment"
env:
CF_PAGES_DEPLOYMENT_URL: https://jf-vue.pages.dev
jobs:
cf_pages_msg:
@ -36,7 +38,7 @@ jobs:
id: compose
env:
COMMIT: ${{ inputs.commit }}
PREVIEW_URL: ${{ inputs.preview_url != '' && (inputs.branch != 'master' && inputs.preview_url || format('https://jf-vue.pages.dev ({0})', inputs.preview_url)) || 'Not available' }}
PREVIEW_URL: ${{ inputs.preview_url != '' && (inputs.branch != 'master' && inputs.preview_url || format('{0} ({1})', env.CF_PAGES_DEPLOYMENT_URL, inputs.preview_url)) || 'Not available' }}
DEPLOY_STATUS: ${{ inputs.in_progress && '🔄 Deploying...' || (inputs.preview_url != '' && '✅ Deployed!' || '❌ Failure. Check workflow logs for details') }}
DEPLOYMENT_TYPE: ${{ inputs.branch != 'master' && '🔀 Preview' || '⚙️ Production' }}
WORKFLOW_RUN: ${{ !inputs.in_progress && format('**[View build logs](https://github.com/{0}/actions/runs/{1})**', github.repository, github.run_id) || '' }}