Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support secrets.GITHUB_TOKEN #27

Open
multimeric opened this issue May 13, 2020 · 4 comments
Open

Support secrets.GITHUB_TOKEN #27

multimeric opened this issue May 13, 2020 · 4 comments

Comments

@multimeric
Copy link

If you are deploying to a gh-pages branch of the current repo, you should be able to use secrets.GITHUB_TOKEN instead of needing a deploy key at all. This would then work the same as all the other github-pages deployment actions, e.g. https://github.com/peaceiris/actions-gh-pages#github-actions-for-github-pages.

This would massively reduce the setup time for using this, since GITHUB_TOKEN exists by default, whereas creating an access token is a bit of a pain.

@oscarmorrison
Copy link

Yes. Something like github-token: ${{ secrets.GITHUB_TOKEN }} would be excellent

@maiwald
Copy link

maiwald commented Jul 10, 2020

I have switched to peaceiris/actions-gh-pages. It is not as specialized as gatsby-gh-pages-action but supports GITHUB_TOKEN. Their README has instructions for deploying Gatsby sites.

@sergiomcalzada
Copy link

You can do it just with

name: Gatsby Publish

on:
  push:
    branches:
      - gatsby

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - uses: enriikke/gatsby-gh-pages-action@v2
        with:
          access-token: x-access-token:${{ secrets.GITHUB_TOKEN }}
          deploy-branch: main

@log-line
Copy link

You can do it just with

name: Gatsby Publish

on:
  push:
    branches:
      - gatsby

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - uses: enriikke/gatsby-gh-pages-action@v2
        with:
          access-token: x-access-token:${{ secrets.GITHUB_TOKEN }}
          deploy-branch: main

Just leaving a quick comment on why/how this works: https://docs.github.com/es/developers/apps/building-github-apps/authenticating-with-github-apps#http-based-git-access-by-an-installation

Nice trick @sergiomcalzada

sopheck added a commit to FuReSH/tool-storage-interface that referenced this issue Mar 27, 2023
holly-cummins added a commit to holly-cummins/gatsby-platform that referenced this issue Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants