Haoliang Yu
Haoliang Yu

Reputation: 3097

How to deploy the github page at another repo

From the documentation of GitHub Pages deployment, it seems possible to deploy an application at repo A to the github pages of another repo B. In my use case, I would like to deploy to an organization github pages organization.github.io. Since the organization github pages only accept files in the master branch, I would like to develop the app at another repo.

So in my development repo (let's call it organization/app), I have such .travis.yml:

language: node_js
node_js:
  - "node"
install:
  - npm install
script:
  - npm run lint
  - npm run build
deploy:
  provider: pages
  local-dir: dist
  github-token: $GITHUB_TOKEN
  skip-cleanup: true
  keep-history: true
  repo: organization/organization.github.io
  target-branch: master
  on:
    branch: master

Even though the repo and target-branch has been specified, Travis CI still deploys all build files to organization/app:gh-pages, notorganization/organization.github.io:master.

For a real word app, see this development repo and the CI deployment log.

Upvotes: 5

Views: 880

Answers (1)

Waldemar Wosiński
Waldemar Wosiński

Reputation: 1580

I had a similar problem. Check if you run a build with right commit hash.

By restarting a build you got an old commit set.

You either set a flow that triggers a build or you trigger a custom build.

Upvotes: 0

Related Questions