Skip to content

Commit

Permalink
ci: publish to GitHub Container Registry (#2165)
Browse files Browse the repository at this point in the history
  • Loading branch information
WesleyRosenblum authored Mar 28, 2024
1 parent 47ea5d8 commit 1887322
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 1887322

Please sign in to comment.