GitHub Actions の self-hosted runner における cache service v1
#GitHub_Actions
GitHub Actions の self-hosted runner における cache service v2
GitHub.com (GHEC)
GitHub.com で workflow を実行すると、GitHub Actions cache は GitHub-hosted な cache service に保管される
GitHub-hosted runner では GitHub-hosted cache service と network 的に近い(たぶん)ので高速だが、self-hosted runner ではだいぶ低速になってしまう
しかし GitHub.com では cache service を変更する方法が提供されていない
ワークアラウンド
custom action
が、setup-foobar が勝手にやる依存関係のキャッシュはどうにもできない
GitHub-hosted cache service にあるようなブランチ単位のアクセス制御も真面目にやるの大変そう
IAM policy で頑張ればいけるか?
https://github.com/whywaita/actions-cache-s3
S3 を cache の backend として使うアクション
custom cache server by patching runner image
cacher service の URL ACTIONS_CACHE_URL は、runner の image に含まれるバイナリにハードコードされている
https://gha-cache-server.falcondev.io/
バイナリに頑張って patch を当てている
https://gha-cache-server.falcondev.io/getting-started#docker
このあたりに頑張って patch を当てて自分で image を build するのもアリかもしれない
https://github.com/search?q=repo%3Aactions%2Frunner%20ACTIONS_CACHE_URL&type=code
GHES
GHES では、enterprise server の管理者が Amazon S3 や Google Cloud Storage といった object storage にデータを保管するように設定できる
https://docs.github.com/en/enterprise-server@3.10/admin/managing-github-actions-for-your-enterprise/enabling-github-actions-for-github-enterprise-server/enabling-github-actions-with-amazon-s3-storage
https://docs.github.com/en/enterprise-server@3.10/admin/managing-github-actions-for-your-enterprise/enabling-github-actions-for-github-enterprise-server/enabling-github-actions-with-google-cloud-storage