Search code examples
buildgithub-actionsgithub-pages

Build GitPages Using GitHub Actions


.github - workflows - github-pages.yml and dry-run.yml


name: Deploy to GitHub Pages

on:
  pull_request:
    branches:
      - master

jobs:
  github-pages:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: helaili/[email protected]
        build_only: true
Footer

name: Deploy to GitHub Pages

on:
  push:
    branches:
      - master

jobs:
  github-pages:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses:  helaili/jekyll-action@v2
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

Git Actions result
Auto-regeneration: disabled. Use --watch to enable.
Jekyll build done
Error: Cannot publish on branch master

master(Default branch) gh-pages(Active branches) I am using two branches.
What is the workaround for the bug?


Solution

  • Maybe you should change

    on:
      push: 
        branches: 
          - master
    

    to another branch