I tried the following code:
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: './dist'
but instead of getting the contents of my dist folder, I was getting my README rendered as HTML. Googling this was very tricky because lots of people have this problem for unrelated reasons. It took some experimentation to discover that a backslash on the path fixes the problem:
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: './dist/'
While I certainly think the first option should have worked, by far the more confusing thing is that the code apparetly silently defaults to showing your root directory (and latterly, showing your README if there is no index.html?). It would be much better if the pipeline failed if the specified path can't be found.