From 131034b294b0b84f1b3b4f6595a8fb8f9f7265c8 Mon Sep 17 00:00:00 2001 From: greg pereira Date: Wed, 29 May 2024 11:53:59 -0700 Subject: [PATCH] refactor to match upstream ilab Signed-off-by: greg pereira --- .github/workflows/instructlab.yaml | 56 ++++++++++++++---------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/.github/workflows/instructlab.yaml b/.github/workflows/instructlab.yaml index bc82e66cf..9bb20b425 100644 --- a/.github/workflows/instructlab.yaml +++ b/.github/workflows/instructlab.yaml @@ -49,26 +49,39 @@ jobs: sudo rm -rf "$AGENT_TOOLSDIRECTORY" - uses: actions/checkout@v4.1.6 + + - uses: docker/setup-buildx-action@v3 + + - name: Login to Container Registry + if: github.ref == 'refs/heads/main' + run: | + docker login ${{ env.REGISTRY }} -u ${{ secrets.REGISTRY_USER }} -p ${{ secrets.REGISTRY_PASSWORD }} + + - name: Extract metadata (tags, labels) for gotbot image + id: ilab_meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.REGISTRY }}/${{ env.REGISTRY_ORG }}/instructlab-${{ matrix.make_target }} - name: Make Instructlab run: make instructlab working-directory: ./training/instructlab - - name: Checkout buildah codebase - id: checkout-buildah - uses: actions/checkout@v4.1.6 + - name: Build and push ilab images + uses: docker/build-push-action@v5 + working-directory: ./training/instructlab with: - repository: containers/buildah - path: buildah - ref: 'main' - - - name: Setup Buildah v1.36 - working-directory: buildah - run: | - sudo apt-get -y -qq update - sudo apt-get -y install bats btrfs-progs git go-md2man golang libapparmor-dev libglib2.0-dev libgpgme11-dev libseccomp-dev libselinux1-dev make skopeo - make runc all SECURITYTAGS="apparmor seccomp" - sudo make install install.runc + context: instructlab + platforms: linux/amd64 + build-args: | + GIT_TAG=stable + push: false + tags: ${{ steps.ilab_meta.outputs.tags }} + labels: ${{ steps.ilab_meta.outputs.labels }} + # cache-from: type=gha + # cache-to: type=gha,mode=max + file: ${{ matrix.containerfile_path }} - name: Build Image id: build_image @@ -83,21 +96,6 @@ jobs: instructlab/ - - name: Login to Container Registry - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - uses: redhat-actions/podman-login@v1.7 - with: - registry: ${{ env.REGISTRY }} - username: ${{ secrets.REGISTRY_USER }} - password: ${{ secrets.REGISTRY_PASSWORD }} - - - name: Push image - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - uses: redhat-actions/push-to-registry@v2.8 - with: - image: ${{ steps.build_image.outputs.image }} - tags: ${{ steps.build_image.outputs.tags }} - registry: ${{ env.REGISTRY }} - name: Publish Job Results to Slack id: slack