This is a composite Github action combining the following steps into one, so the whole deployment step can be made conditional with a single if statement:
This step deploys the files in the doc folder, but only if branch is main:
steps:
- name: Deploy Github Pages
if: github.ref == 'refs/heads/main'
uses: kayahr/deploy-github-pages-action@v4
with:
path: doc