0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Github にコミットする gradle plugin

Last updated at Posted at 2025-09-28

概要/環境

自分メモ

  • Kotlin 2.2.20
  • Gradle 8.11
  • Github アカウント

設定

Githubに user-id.github.io というリポジトリを作成。
ここでは、setting > Default branch でgh-pagesを設定。

build.gradle.kts
plugins{
    id("org.ajoberstar.git-publish") version "5.1.2"
    // https://mvnrepository.com/artifact/org.ajoberstar.git-publish/gradle-git-publish
}
build.gradle.kts
gitPublish {
    repoUri = "https://github.com/user-id/user-id.github.io.git" // リポジトリ
    branch = "gh-pages" // Default branch で設定したブランチを
    contents {
        from("build/...") // 生成ファイル置き場を指定
        into("package1") // ここでは package1フォルダ以下にファイルを配置する
    }
    preserve {
        include("**/*")
    }
}

コミット

ビルド作業後

sh gradlew gitPublishCommit gitPublishPush

アクセス

https://user-id.github.io/package1/target-file

備考

ファイルサイズ最大50MB

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?