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

Github ActionsでGithub pagesをデプロイする #71

Closed
Rindrics opened this issue May 18, 2020 · 0 comments · Fixed by #101
Closed

Github ActionsでGithub pagesをデプロイする #71

Rindrics opened this issue May 18, 2020 · 0 comments · Fixed by #101

Comments

@Rindrics
Copy link
Collaborator

Rindrics commented May 18, 2020

  • Travis CI と Github pagesは認証が面倒也
  • Hadley ネ申がGithub Actionsを使えとコメント
  • Github ActionsにはJK-junkin隊員のPersonal Access Tokenの設定が必要
  • 航海が終わったらやる。それまでは動作確認をForked branchのサイト で確認するべし。

Github ActionsでGithub Pagesのデプロイを行う方法

1. Personal Access Tokenの発行

  • AccountのSetting ➡️ Developer Setting (Options Columnsの一番下) ➡️ Personal Access Token ➡️ Generate New Token

  • Public Repository用として作るなら Repo の中の public-repo にチェック。

  • Generate TokenでPATを作成する。コピーして控えておく。

2. PATのSecret化

  • RepositoryのSetting ➡️ Secret (Options Columnsの一番下) ➡️ New Secret ➡️ NAME にToken名を入れる(e.g. Gyokaikyo_PAT):arrow_right: Value に1. Personal Access Tokenの発行で作ったPATを入力。
  • Add SecretでSecret Keyの作成。

3. Github Actionsの使用

  • use_github_action("pkgdown")
  • .github/workflows/pkgdown.yamlGITHUB_PAT の編集
on:
  push:
    branches: master

name: pkgdown

jobs:
  pkgdown:
    runs-on: macOS-latest
    env:
      GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 
  #ここを2.で作った{{Gyokaikyo_PAT}}に

4.Home directoryの整理

  • pkgdown.yaml.githubにあるため、重複しているHome dirの_pkgdown.ymlは削除 🔥 する。
  • .travis.yml 内の pkgdown 関連を削除する
before_cache: Rscript -e 'remotes::install_cran("pkgdown")'
deploy:
  provider: script
  script: Rscript -e 'pkgdown::deploy_site_github()'
  skip_cleanup: true
  • gh_pages ブランチは新たにGithub Actions経由で生成されるため、既にTravis 🧔 が作っている場合は削除する。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants