From 18873227448a29c254534bb8c0b14c0c1732561f Mon Sep 17 00:00:00 2001 From: Wesley Rosenblum <55108558+WesleyRosenblum@users.noreply.github.com> Date: Thu, 28 Mar 2024 16:39:44 -0700 Subject: [PATCH] ci: publish to GitHub Container Registry (#2165) --- .github/workflows/release.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ca92562306..708df06095 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,15 +28,16 @@ jobs: - name: Compute tags id: tags run: | - DOCKER_IMAGE=public.ecr.aws/s2n/s2n-quic-qns + ECR_IMAGE=public.ecr.aws/s2n/s2n-quic-qns + GHCR_IMAGE=ghcr.io/aws/s2n-quic/s2n-quic-qns VERSION=main if [[ $GITHUB_REF == refs/tags/* ]]; then VERSION=${GITHUB_REF#refs/tags/v} fi - TAGS="${DOCKER_IMAGE}:${VERSION}" + TAGS="${ECR_IMAGE}:${VERSION},${GHCR_IMAGE}:${VERSION}" # mark the latest on release if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then - TAGS="$TAGS,${DOCKER_IMAGE}:latest" + TAGS="$TAGS,${ECR_IMAGE}:latest,${GHCR_IMAGE}:latest" fi echo "tags=${TAGS}" >> $GITHUB_OUTPUT @@ -48,6 +49,14 @@ jobs: username: ${{ secrets.AWS_ACCESS_KEY_ID }} password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v3.1.0 + if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push image uses: docker/build-push-action@v5 with: