P.S. You can also check out our example Pages starter workflows, though keep in mind they have some template variables in them that need to be replaced if you attempt to copy them directly. They are also offered up in the GitHub UI based on your repository contents when you change your repository's Pages settings to build using Actions (in which case the template variables are replaced).
This is the official Action for uploading Pages artifacts. It is a composite Action that basically runs a
tar
command followed by running theactions/upload-artifact
Action you were already using.P.S. You can also check out our example Pages starter workflows, though keep in mind they have some template variables in them that need to be replaced if you attempt to copy them directly. They are also offered up in the GitHub UI based on your repository contents when you change your repository's Pages settings to build using Actions (in which case the template variables are replaced).