LoginSignup
3
1

GitHub Actionsでキャッシュを利用してワークフローの時間を短縮する

Posted at

GitHub ActionsでApp Distributionに配布する際、キャッシュが利用する事でワークフローの時間を短縮させる事ができたので紹介いたします。

■やりたい事

Podfileに変更がなかった場合には、キャッシュを利用してPod installの処理をスキップさせたい。

■作業手順

    - name: Cache Pods
      id: cache_id  //①IDを付与する。 1
      uses: actions/cache@v2
      with:
        path: Pods
        key: ${{ runner.os }}-${{ hashFiles('**/Podfile.lock') }}
    - name: Pod install
      if: steps.①のID名.outputs.cache-hit != 'true'  //②付与したID名を入れる 2
      run: pod install

■結果

確認した所、Pod installがちゃんとスキップされていました。
これでPod installでかかっていた時間が削減されました!(私の場合は約3~5分)
スクリーンショット 2023-08-18 17.17.44.png

3
1
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
3
1