Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
Fix GitHub pages deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
leoarnold committed Apr 22, 2019
1 parent bd51646 commit 02ca9d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
11 changes: 1 addition & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,4 @@ jobs:
- stage: Update GitHub Pages
if: branch = release
rvm: 2.6.1
script: skip
before_deploy: bundle exec rake github:pages
deploy:
provider: pages
local-dir: doc
github-token: "$GITHUB_TOKEN"
keep-history: true
skip_cleanup: true
on:
branch: release
script: bundle exec rake github:pages
13 changes: 12 additions & 1 deletion rakelib/github.rake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace :github do
end

desc 'Generate Yard documentation in /doc'
task pages: ['strings:generate', 'strings:gh_pages:configure']
task pages: %i[github:token strings:gh_pages:update]

desc 'Release the module on GitHub'
task release: %i[clean build] do
Expand Down Expand Up @@ -46,4 +46,15 @@ namespace :github do

puts '[GitHub] Module successfully released'
end

task :token do
require 'uri'

remote_uri = URI(`git remote get-url origin`.strip)

remote_uri.user = ENV['GITHUB_USERNAME']
remote_uri.password = ENV['GITHUB_TOKEN']

system("git remote set-url origin #{remote_uri}")
end
end

0 comments on commit 02ca9d4

Please sign in to comment.