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

documentation for use with Travis CI #226

Closed
spences10 opened this issue Jan 15, 2018 · 4 comments
Closed

documentation for use with Travis CI #226

spences10 opened this issue Jan 15, 2018 · 4 comments

Comments

@spences10
Copy link

Hi thanks for gh-pages we use it to deploy [our site] via our individual machines once we merge development into master

I was hoping I could use gh-pages with Travis CI but I haven't managed to get anything running so far so I thought I ask:

As I mentioned we use gh-pages via an npm script with:

"deploy": "gatsby build --prefix-paths && gh-pages -d public",

Travis CI fails with an authentication error, so I created a GitHub token with the repo scope and added that to the Travis settings and then have the .yml script to call:

"deploy:travis":
  "gatsby build --prefix-paths && https://$GITHUB_TOKEN@github.com/chingu-voyage3/grad.then.git -d public"

The .travis.yml calls the deploy:travis script:

after_script: 
  - if [ "$TRAVIS_BRANCH" = "master" ]; then npm run deploy:travis; fi 

Travis CI has the following:

sh: 1: https://[secure]@github.com/chingu-voyage3/grad.then.git: not found

Is there anything I'm missing here?

[our site] https://github.com/chingu-voyage3/grad.then/projects

@mfrachet
Copy link

Any update on this one ?

@spences10
Copy link
Author

Forgot I logged this @mfrachet 🙃

We used a manual process in the end

@jeremenichelli
Copy link

A couple of recommendations here 🙂

Instead of hard checking the branch, use the Travis deploy action:

deploy:
  provider: script
  script: npm run deploy:travis
  skip_cleanup: true
  on:
    branch: master

If you are creating manual processes, check GH_TOKEN permissions in Travis, and use the form url of:

git push --force https://${GH_TOKEN}@github.com/owner/repository.git HEAD:branch_destination

Specially in private repositories were Git is going to return a not found even on tokens with push permission.

About the documentation, I don't know how much belongs here since the package just takes the output folder you want and force pushes to gh-pages branch.

Anyways, hope this helped.

@spences10
Copy link
Author

Stale, closing

jeremyckahn added a commit to jeremyckahn/farmhand that referenced this issue Jun 11, 2019
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

3 participants