From 49e1e7638c4eb755f02b1f166100f90390463134 Mon Sep 17 00:00:00 2001 From: Stefano Ortolani Date: Wed, 6 Dec 2023 14:15:19 +0000 Subject: [PATCH] Test new actions --- .github/workflows/test-build-latest.yml | 38 ++++++++++++++++--------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-build-latest.yml b/.github/workflows/test-build-latest.yml index c5b1b45..3df9061 100644 --- a/.github/workflows/test-build-latest.yml +++ b/.github/workflows/test-build-latest.yml @@ -1,7 +1,6 @@ name: Build the Docker images on: - # Only trigger the workflow when there is a PR on the master branch pull_request: branches: [ "master" ] @@ -11,21 +10,34 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - - name: Set up QEMU (for ARM emulation) - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - - name: Build the Docker images - env: - GITHUB_CONTEXT: ${{ toJson(github) }} + - name: Initialize environment run: | - # Initialize variables - DOCKER_IMG_TAG=`echo "${{ github.sha }}" | cut -c 1-7` - # Create the environment sed -e '/^[[:space:]]*$/d' -e '/[#@]/d' -e 's/\"//g' -e 's/\(^[^=]*\)=\(.*\)/\1="\2"/' template.env > env.hcl - # Build and Push - DOCKER_IMG_TAG=$DOCKER_IMG_TAG DOCKER_USERNAME=local docker buildx bake -f docker-bake.hcl -f env.hcl + + - name: Build and push + uses: docker/bake-action@v4 + with: + push: false + files: + docker-bake.hcl + env.hcl + + + # - name: Build the Docker images + # env: + # GITHUB_CONTEXT: ${{ toJson(github) }} + # run: | + # # Initialize variables + # DOCKER_IMG_TAG=`echo "${{ github.sha }}" | cut -c 1-7` + # # Create the environment + # sed -e '/^[[:space:]]*$/d' -e '/[#@]/d' -e 's/\"//g' -e 's/\(^[^=]*\)=\(.*\)/\1="\2"/' template.env > env.hcl + # # Build and Push + # DOCKER_IMG_TAG=$DOCKER_IMG_TAG DOCKER_USERNAME=local docker buildx bake -f docker-bake.hcl -f env.hcl