How to chain together separate Github actions for angular

  docker, dockerfile, github, github-actions

I have an angular project on Github built by Jenkins with

npm install
npm run build

This creates the dist folder which gets copied to tomcat running on an ec2 instance.

I’m planning to change the flow so that the project gets built using Github actions instead of Jenkins and once built the dist folder gets copied to docker image(tomcat:jdk11-openjdk-slim-buster) via Dockerfile.

I can find Github workflow for building docker image from Dockerfile. But that workflow would require the dist folder to already be present so that it can be copied.

Is there a way I can chain the npm build phase with the part where dist/ is copied?
If there are two Github actions, will the second one get the artifacts from the first one?

Source: Docker Questions