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:
You can use the
env
context in the value of any key in a step except for the id and uses keys.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.