How can I use the global environment variable (that I set at the top of the file) as my port number in Github Action (.yml config file)? Is this possible?
I have tried
env:
APP_PORT: 3306
......
services:
mysql:
....
ports:
- ${{ env.APP_PORT }}
What you are trying to do is not possible, as services are defined below a job and not below a step:
source: https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#env-context)