I have a Node/Express project which use the azure-ts-node-starter project. By default it compiles Typescript from /src into /dist (package.json below)
I'd like to delpoy to Azure every time I upload to the master branch of my Github repo but I'm not sure what to do with src/dist folders.
Should I build on my PC, then commit everything, which I think would give me the choice of using Azure deployment center OR Github actions (not sure of the difference yet) to deploy the whole project or...
Could I put the /dist folder in gitignore and only upload src files, then somehow build it every time I push to master?
If I do the second option, would it just deploy the contents of the /dist folder and not send all the source files to Azure? That would seem sensible but wouldn't it need some files from the main directory, such as the package.json file so that it knows how to start?
Apologies if this question isn't well formed, I'm not sure what I need to ask. I guess the questions is what is the standard way commit and deploy projects which use a dist directory?
Here are the scripts in the package.json file.
"scripts": {
"build": "npm run build-ts && npm run copy-static-assets",
"build-ts": "tsc",
"copy-static-assets": "ts-node copyStaticAssets.ts",
"serve": "node dist/server.js",
"start": "npm run serve",
"watch": "concurrently -k -p "[{name}]" -n "TypeScript,Node" -c "cyan.bold,green.bold" "npm run watch-ts" "npm run watch-node"",
"watch-node": "nodemon dist/server.js",
"watch-ts": "tsc -w"
},
question from:
https://stackoverflow.com/questions/65850014/build-node-express-using-github-actions-and-deploy-to-azure-web-app 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…