From 3622c53848629154913a69e28f46c34c0d0eb60c Mon Sep 17 00:00:00 2001 From: Alessandro Palmas Date: Thu, 28 Sep 2023 23:42:37 -0400 Subject: [PATCH] Optimize agents build using artifacts, trigger docs rebuild for release branch too --- ...ult.yaml => build-push-agents-images.yaml} | 26 +++++++++++++++---- .github/workflows/docs-rebuild.yaml | 1 + .github/workflows/reusable_unit_tests.yaml | 1 + 3 files changed, 23 insertions(+), 5 deletions(-) rename .github/workflows/{default.yaml => build-push-agents-images.yaml} (82%) diff --git a/.github/workflows/default.yaml b/.github/workflows/build-push-agents-images.yaml similarity index 82% rename from .github/workflows/default.yaml rename to .github/workflows/build-push-agents-images.yaml index 8d2188e..cd2de48 100644 --- a/.github/workflows/default.yaml +++ b/.github/workflows/build-push-agents-images.yaml @@ -18,8 +18,25 @@ jobs: fetch-depth: 0 - id: set-matrix run: echo "::set-output name=matrix::$(./.github/workflows/generate-image-build-matrix basic/* *)" + + checkout_and_download_lfs: + name: Checkout and Download LFS + runs-on: ubuntu-22.04 + steps: + - name: Checkout selected branch + uses: actions/checkout@v3 + with: + repository: diambra/agents + lfs: true + + - name: Store repo with LFS files as artifacts + uses: actions/upload-artifact@v3 + with: + name: repo-lfs-artifacts + path: . # You can specify the path to the LFS files if they are in a specific directory + build-and-push-images: - needs: [generate-matrix] + needs: [generate-matrix, checkout_and_download_lfs] runs-on: ubuntu-latest if: ${{ needs.generate-matrix.outputs.matrix != '[]' }} strategy: @@ -28,11 +45,10 @@ jobs: include: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} steps: - - name: Checkout - uses: actions/checkout@v3 + - name: Restore repo with LFS files from artifacts + uses: actions/download-artifact@v3 with: - repository: diambra/agents - lfs: true + name: repo-lfs-artifacts - name: Login to GHCR uses: docker/login-action@v2 diff --git a/.github/workflows/docs-rebuild.yaml b/.github/workflows/docs-rebuild.yaml index 0a6415b..01f8974 100644 --- a/.github/workflows/docs-rebuild.yaml +++ b/.github/workflows/docs-rebuild.yaml @@ -4,6 +4,7 @@ on: push: branches: - main + - release-2.1 jobs: docs-rebuild-deploy: diff --git a/.github/workflows/reusable_unit_tests.yaml b/.github/workflows/reusable_unit_tests.yaml index ab63812..3a09aae 100644 --- a/.github/workflows/reusable_unit_tests.yaml +++ b/.github/workflows/reusable_unit_tests.yaml @@ -12,6 +12,7 @@ on: jobs: checkout_and_download_lfs: + name: Checkout and Download LFS runs-on: ubuntu-22.04 steps: - name: Checkout selected branch