-
Notifications
You must be signed in to change notification settings - Fork 119
66 lines (57 loc) · 1.95 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
on:
push:
branches:
- main
tags:
- "v*.*.*"
pull_request:
branches:
- main
release:
types: [published]
name: release
jobs:
qns:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.6.1
- name: Compute tags
id: tags
run: |
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="${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,${ECR_IMAGE}:latest,${GHCR_IMAGE}:latest"
fi
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
- name: Login to Amazon Elastic Container Registry Public
uses: docker/login-action@v3.3.0
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
with:
registry: public.ecr.aws
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3.3.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@v6
with:
tags: ${{ steps.tags.outputs.tags }}
file: quic/s2n-quic-qns/etc/Dockerfile
target: default
push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}