8
Go to list of users who liked
0
Share on X(Twitter)
Share on Facebook
More than 3 years have passed since last update.
GitHub ActionsとRcloneでGitHub管理されているファイルをGoogle Driveに同期する
Last updated atPosted at 2022-09-20
組織の中で、GitHubアカウントを持っていない人に対してGitHub管理されているファイルを共有したいなんてことがあるかもしれません。
今回は、GitHub ActionsとRcloneを利用して、GitHub管理されているファイルをGoogle Driveに同期したので手順をまとめます。
Rcloneについては以前に記事を書きましたのでこちらを御覧ください。
RcloneでmacOSとGoogle Driveのファイルを同期してみた - Qiita
1. Rcloneの設定ファイルを作成する
以前に書いた記事の初期設定としてrclone config を実行しました。
初期設定が完了すると設定ファイル(~/.config/rclone/rclone.conf)が生成されるので内容を控えておきます。
2. GitHub ActionsのSecretsに登録する
以下の内容をGithub ActionsのSecretsに登録します。
名前:RCLONE_CONF
内容: 手順1で控えた設定ファイルの内容
3. ワークフローを作成する
今回はマーケットプレイスに公開されているアクションを利用しました。
.github/workflows/sync-github-and-gdrive.yml
name:Sync GitHub and Google Driveon:pushjobs:rclone:runs-on:ubuntu-lateststeps:-uses:actions/checkout@master-name:rcloneuses:wei/rclone@v1env:RCLONE_CONF:${{ secrets.RCLONE_CONF }}with:args:sync <source>:<source_path> <dest>:<dest_path># 例# args: sync ./rclone_test google_drive:rclone_testwei/rclone: Wraps the rclone CLI to be used in Github Actions
4. リポジトリにpushする
GitHub Actionsが実行され、Google Driveにファイルが同期されれば成功です。
以上です。
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme

