Skip to content

Skip CNAME on forks #545

Answered by peaceiris
friederbluemle asked this question in Q&A
Dec 10, 2020 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Suggestion 1

Skip deployment on forks.

- name: Deploy
  uses: peaceiris/actions-gh-pages@v3
  if: github.event.repository.fork == false
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    publish_dir: ./public
    cname: peaceiris.com

Suggestion 2

Set cname to empty on forks.

- name: Set CNAME
  id: cname
  run: |
    if [ ${{ github.event.repository.fork }} = 'false' ]; then
      echo "::set-output name=cname::peaceiris.com"
    fi

- name: Deploy
  uses: peaceiris/actions-gh-pages@v3
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    publish_dir: ./public
    cname: ${{ steps.cname.outputs.cname }}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@friederbluemle
Comment options

Answer selected by friederbluemle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #545 on December 24, 2020 03:02.