Code Monkey home page Code Monkey logo

Comments (9)

yoannchaudet avatar yoannchaudet commented on May 28, 2024 1

It's either your site deploys from a branch and we enforce some security rules on your behalf. Or you use take control with GitHub Actions. The "official Actions" you refer to are designed for the later case.

from deploy-pages.

cengique avatar cengique commented on May 28, 2024 1

That actually succeeded! I wasn't aware of the "Environments" section on the Settings page. So I will make sure that it's set up next time. Thanks again for helping with this.

from deploy-pages.

yoannchaudet avatar yoannchaudet commented on May 28, 2024

In the settings for Pages on your repo, change the source from Branch to GitHub Actions. This will allow you to control Pages deployments with your workflow exclusively.

from deploy-pages.

cengique avatar cengique commented on May 28, 2024

Ok, I didn't see that it was an option. However, I was trying use the official actions like this one in my own workflow. I think the reason for the error was because it was trying to do it from master and not gh-pages. So instead I would have to push to the gh-pages branch and then let Pages deploy that automatically?

from deploy-pages.

cengique avatar cengique commented on May 28, 2024

I was trying to follow your advice, but the Github documentation for that feature is telling me to actually use your action from the default branch (see step 5): https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#creating-a-custom-github-actions-workflow-to-publish-your-site

from deploy-pages.

cengique avatar cengique commented on May 28, 2024

I create a clean version of the workflow and here's the fail log.
image

from deploy-pages.

yoannchaudet avatar yoannchaudet commented on May 28, 2024

@cengique The documentation you are referring makes the assumption your Pages site is configured with Source = GitHub Actions in the settings.

When you configure your site to publish with GitHub Actions, GitHub will suggest starter workflows for common publishing scenarios. The general flow of a workflow is to:

This is not the case for GGC-STaRS/GGC-STaRS.github.io. Follow the steps here and try again.

from deploy-pages.

cengique avatar cengique commented on May 28, 2024

@yoannchaudet the above screenshot was produced when I had Source="Github Actions" and when it didn't work, had reverted back. I just checked again in commit 13d4922 with Source=GA and this workflow, and I'm still getting the exact same error as in the above screenshot. Notice that this time it does not explicitly complain about not being on the gh-pages branch, but it's some other kind of environment protection. I do have the environment defined in the deploy step as follows:

deploy:      
    # Deploy to the github-pages environment
    # (only accepts being run from gh-pages,
    # potentially in a separate workflow file)
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }} 
    runs-on: ubuntu-latest
    needs: build
    steps:
      - name: Deploy to GitHub Pages 🚀
        id: deployment
        uses: actions/deploy-pages@v1

from deploy-pages.

yoannchaudet avatar yoannchaudet commented on May 28, 2024

@cengique Pages defines sensible security defaults for you. When you switch back and forth between Actions/branch publication, you have a bit of work to do.

You have full control over the branch protection for your environments in the settings of your repo (see here).

This is an Actions check, not a Pages one:

image

from deploy-pages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.