From e49c8c5c9d26e432d01b2c70b8d16b5b21d1849a Mon Sep 17 00:00:00 2001 From: Scott J Dickerson Date: Wed, 7 Aug 2024 18:03:43 -0400 Subject: [PATCH] CI build testing - image build 2, npm cache for qemu npm install stability - ci-repo concurrency Signed-off-by: Scott J Dickerson --- .github/workflows/image-build-2.yaml | 50 +++++++++++++++++----------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/.github/workflows/image-build-2.yaml b/.github/workflows/image-build-2.yaml index c76c15dc93..eee9a40fa3 100644 --- a/.github/workflows/image-build-2.yaml +++ b/.github/workflows/image-build-2.yaml @@ -1,4 +1,4 @@ -name: Multiple Architecture Image Build 2 +name: Image Build 2 on: workflow_dispatch: @@ -14,12 +14,16 @@ concurrency: cancel-in-progress: true env: - tag: ${{ github.ref == 'refs/heads/main' && 'latest' || github.ref_name }} + tag: ${{ github.ref == 'refs/heads/main' && 'latest1' || github.ref_name }} # what is normally sent in as input registry: "quay.io/sdickers" image_name: "tackle2-ui" containerfile: "./Dockerfile" + context: "." + + architectures: '[ "amd64", "arm64" ]' + extra-args: "--ulimit nofile=4096:4096" # pre_build_cmd: | @@ -32,19 +36,21 @@ jobs: runs-on: ubuntu-latest # setup a npm mirror server so multiple npm installs can share fetches - # services: - # npm-mirror: - # image: verdaccio/verdaccio:5 - # ports: - # - 4873:4873 + services: + npm-mirror: + image: verdaccio/verdaccio:5 + ports: + - 4873:4873 strategy: matrix: - architecture: - - "amd64" - - "arm64" - - "ppc64le" - - "s390x" + architecture: # can't use `env` here.. ${{ fromJson(env.architectures) }} + - amd64 + - arm64 + + # concurrency: + # group: image-build-2-${{ github.ref }}-${{ matrix.architecture }} + # cancel-in-progress: true steps: - name: Maximize disk space @@ -60,12 +66,17 @@ jobs: df . -h - name: Checkout - uses: actions/checkout@main + uses: actions/checkout@v4 - - name: Configure QEMU + - name: Proxy npm registry to the "npm-mirror" service + run: | + echo "registry=\"http://npm-mirror:4873\"" >> .npmrc + + - name: Setup QEMU to be able to build on ${{ matrix.architecture }} + if: ${{ matrix.architecture != 'amd64' }} uses: docker/setup-qemu-action@master with: - platforms: all + platforms: ${{ matrix.architecture }} - name: Image meta id: meta @@ -81,10 +92,10 @@ jobs: type=ref,event=pr type=sha - - name: Run pre build command - shell: bash - run: "${{ env.pre_build_cmd }}" - if: "${{ env.pre_build_cmd != '' }}" + # - name: Run pre build command + # shell: bash + # run: "${{ env.pre_build_cmd }}" + # if: "${{ env.pre_build_cmd != '' }}" - name: Build Image id: build @@ -96,6 +107,7 @@ jobs: archs: ${{ matrix.architecture }} labels: ${{ steps.meta.outputs.labels }} containerfiles: ${{ env.containerfile }} + context: ${{ env.context }} - name: Push To Quay uses: redhat-actions/push-to-registry@main