From a7b5f23c3741e85a79f1f24172876bb48c0631b0 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 2 Nov 2023 17:47:17 -0700 Subject: [PATCH] feat: push completed image --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++++-- makeDockerfile.ts | 4 +++- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d94dc2c4..356d5277 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,8 +11,13 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +env: + REGISTRY: ghcr.io + LATEST_TAG: ghcr.io/agoric/agoric-3-proposals:latest + jobs: - test-proposals: + # see https://docs.docker.com/build/ci/github-actions/test-before-push/ + tests-proposals: runs-on: ubuntu-latest timeout-minutes: 60 steps: @@ -29,12 +34,30 @@ jobs: sudo rm -rf "$AGENT_TOOLSDIRECTORY" echo "=== After cleanup:" df -h - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Docker Registry + uses: docker/login-action@v3 + with: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + registry: ${{ env.REGISTRY }} + # The .ts scripts depend upon this - run: yarn global add tsx - name: build test images run: ./buildTestImages.ts - name: run test images run: ./runTestImages.ts + # this should be fast because all the stages were already built + - name: Build and push complete image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ env.LATEST_TAG }} - name: notify on failure if: failure() && github.event_name != 'pull_request' uses: ./.github/actions/notify-status diff --git a/makeDockerfile.ts b/makeDockerfile.ts index 75a20f3f..dffebc03 100755 --- a/makeDockerfile.ts +++ b/makeDockerfile.ts @@ -166,8 +166,10 @@ for (const proposal of readProposals()) { blocks.push(stage.EXECUTE(proposal)); } - blocks.push(stage.USE(proposal)); + // TEST depends on USE but define it first but Docker can resolve the dependencies in any order. blocks.push(stage.TEST(proposal)); + // Put USE last so that the last proposal is the default target to build. + blocks.push(stage.USE(proposal)); previousProposal = proposal; }