From 816cf8867ebdfe00c220cc49713261bb1f07b9bb Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Wed, 25 May 2022 22:45:30 -0400 Subject: [PATCH] ci: create manifest from nightly db dev images (x64 + arm64) --- .github/workflows/dev-db-nightly.yml | 52 +++++++++++++++++++++------- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/.github/workflows/dev-db-nightly.yml b/.github/workflows/dev-db-nightly.yml index 9d62103e1..15c893e83 100644 --- a/.github/workflows/dev-db-nightly.yml +++ b/.github/workflows/dev-db-nightly.yml @@ -20,24 +20,24 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: - -env: - REGISTRY: ghcr.io - IMAGE_NAME: datatracker-db jobs: build: + name: Build Docker Images runs-on: ubuntu-latest if: ${{ github.ref == 'refs/heads/main' }} permissions: contents: read packages: write + strategy: + matrix: + include: + - platform: linux/arm64 + docker: arm64 + - platform: linux/amd64 + docker: x64 steps: - uses: actions/checkout@v2 - - - name: Get Current Date as Tag - id: date - run: echo "::set-output name=date::$(date +'%Y%m%d')" - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -57,9 +57,35 @@ jobs: with: context: . file: docker/db.Dockerfile - platforms: linux/amd64 - # platforms: linux/amd64,linux/arm64 + platforms: ${{ matrix.platform }} push: true - tags: | - ghcr.io/ietf-tools/datatracker-db:nightly-${{ steps.date.outputs.date }} - ghcr.io/ietf-tools/datatracker-db:latest + tags: ghcr.io/ietf-tools/datatracker-db:latest-${{ matrix.platform }} + + combine: + name: Create Docker Manifests + runs-on: ubuntu-latest + needs: [build] + permissions: + packages: write + steps: + - uses: actions/checkout@v2 + + - name: Get Current Date as Tag + id: date + run: echo "::set-output name=date::$(date +'%Y%m%d')" + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create and Push Manifests + run: | + echo "Creating the manifests..." + docker manifest create ghcr.io/ietf-tools/datatracker-db:nightly-${{ steps.date.outputs.date }} ghcr.io/ietf-tools/datatracker-db:latest-x64 ghcr.io/ietf-tools/datatracker-db:latest-arm64 + docker manifest create ghcr.io/ietf-tools/datatracker-db:latest ghcr.io/ietf-tools/datatracker-db:latest-x64 ghcr.io/ietf-tools/datatracker-db:latest-arm64 + echo "Pushing the manifests..." + docker manifest push -p ghcr.io/ietf-tools/datatracker-db:nightly-${{ steps.date.outputs.date }} + docker manifest push -p ghcr.io/ietf-tools/datatracker-db:latest