diff --git a/.github/actions/push-digests/action.yml b/.github/actions/push-digests/action.yml index a72fad3..229b11b 100644 --- a/.github/actions/push-digests/action.yml +++ b/.github/actions/push-digests/action.yml @@ -19,10 +19,12 @@ inputs: id: required: false description: "The id of the image to push the digests to" + default: "0" tag: required: false description: "The tag of the image to push the digests to" default: "" + runs: using: 'composite' steps: @@ -33,7 +35,7 @@ runs: - name: Log in to container registry. if: ${{ inputs.registry == 'ghcr.io' }} - uses: FhenixProtocol/actions/.github/actions/registry-login@v1.0.5 + uses: FhenixProtocol/actions/.github/actions/registry-login@alon.dotan/feature/support_builders with: service_account_key: ${{ inputs.service_account_key }} registry: ${{ inputs.registry }} @@ -43,7 +45,7 @@ runs: uses: actions/download-artifact@v4 with: path: ${{ runner.temp }}/digests - pattern: digests-*-${{ inputs.id }}-${{ github.job }} + pattern: digests*${{ inputs.id }}*${{ github.run_id }} merge-multiple: true - name: Set tag based on trigger diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 8fe454c..fd252e2 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -5,14 +5,14 @@ on: pull_request: paths: - - '.github/workflows/**' + - '.github/**' jobs: build-and-push: permissions: contents: read packages: write - uses: ./.github/workflows/docker_build.yml + uses: FhenixProtocol/actions/.github/workflows/docker_build.yml@alon.dotan/feature/support_builders with: registry: 'ghcr.io' image_name: 'fhenixprotocol/actions/ubuntu' diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index 2cfdc35..4c0525d 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -21,10 +21,6 @@ on: platforms: required: false type: string - runs_on: - required: false - type: string - default: '["ubuntu-latest", "ubuntu-latest-arm64"]' build_args: required: false type: string @@ -32,7 +28,7 @@ on: id: required: false type: string - default: '' + default: '0' context: required: false type: string @@ -41,6 +37,14 @@ on: required: false type: string default: '' + arm_runner: + required: false + type: string + default: 'ubuntu-24.04-arm' + amd64_runner: + required: false + type: string + default: 'ubuntu-24.04' secrets: service_account_key: required: false @@ -53,8 +57,13 @@ jobs: build: strategy: matrix: - runs_on: ${{ fromJSON(inputs.runs_on) }} - runs-on: ${{ matrix.runs_on }} + include: + - platform: linux/amd64 + runner: ${{ inputs.amd64_runner }} + - platform: linux/arm64 + runner: ${{ inputs.arm_runner }} + + runs-on: ${{ matrix.runner }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -71,7 +80,7 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Log in to container registry. if: ${{ inputs.registry == 'ghcr.io' }} - uses: FhenixProtocol/actions/.github/actions/registry-login@v1.0.5 + uses: FhenixProtocol/actions/.github/actions/registry-login@alon.dotan/feature/support_builders with: service_account_key: ${{ secrets.service_account_key }} registry: ${{ inputs.registry }} @@ -86,7 +95,7 @@ jobs: uses: docker/build-push-action@v5 with: context: ${{ inputs.context }} - platforms: ${{ inputs.runs_on }} + platforms: ${{ inputs.platforms }} file: ${{ inputs.dockerfile }} tags: ${{ inputs.registry }}/${{ inputs.image_name }} labels: ${{ steps.meta.outputs.labels }} @@ -102,17 +111,18 @@ jobs: - name: Upload digest uses: actions/upload-artifact@v4 with: - name: digests-${{ matrix.runs_on }}-${{ inputs.id }}-${{ github.job }} + name: digests-${{ env.PLATFORM_PAIR }}-${{ inputs.id }}-${{ github.run_id }} path: ${{ runner.temp }}/digests/* if-no-files-found: error retention-days: 1 + merge: runs-on: ubuntu-latest needs: - build steps: - name: Push digests - uses: FhenixProtocol/actions/.github/actions/push-digests@v1.0.5 + uses: FhenixProtocol/actions/.github/actions/push-digests@alon.dotan/feature/support_builders with: registry: ${{ inputs.registry }} image_name: "${{ inputs.image_name }}" diff --git a/Dockerfile b/Dockerfile index 5ade7a1..3d4214c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM ubuntu:latest +RUN apt-get update && apt-get install -y lsb-release + RUN lsb_release -a RUN uname -a