Skip to content

Commit b64df7d

Browse files
committed
[OB] Build and push to outerbounds ECR
1 parent 05c5626 commit b64df7d

File tree

1 file changed

+43
-28
lines changed

1 file changed

+43
-28
lines changed

.github/workflows/release.yml

Lines changed: 43 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,20 @@ on:
77
branches:
88
- master
99
- dev-*
10+
- release-*
1011

1112
defaults:
1213
run:
1314
shell: bash
1415

1516
permissions:
1617
contents: read
18+
id-token: write
1719

1820
jobs:
1921
build-binaries:
2022
runs-on: ubuntu-20.04
21-
if: github.repository == 'argoproj/argo-events'
23+
if: github.repository == 'outerbounds/argo-events'
2224
name: Build binaries
2325
steps:
2426
- name: Checkout
@@ -27,7 +29,7 @@ jobs:
2729
- name: Setup Go
2830
uses: actions/setup-go@v5
2931
with:
30-
go-version: "1.23"
32+
go-version: "1.22"
3133

3234
- name: Build binaries
3335
run: |
@@ -44,42 +46,55 @@ jobs:
4446
build-push-linux-multi:
4547
name: Build & push linux/amd64 and linux/arm64
4648
needs: [ build-binaries ]
47-
runs-on: ubuntu-20.04
48-
if: github.repository == 'argoproj/argo-events'
49+
runs-on: ubuntu-latest
50+
if: github.repository == 'outerbounds/argo-events'
4951
strategy:
5052
matrix:
5153
target: [ argo-events ]
54+
env:
55+
ECR_REGISTRY: 006988687827.dkr.ecr.us-west-2.amazonaws.com
56+
IMAGE_NAME: obp-argo-events
5257
steps:
5358
- uses: actions/checkout@v4
5459

55-
- name: Set up Docker Buildx
56-
uses: docker/setup-buildx-action@v3
57-
58-
- name: Download binaries
59-
uses: actions/download-artifact@v3
60+
- name: Generate build ID
61+
id: prep
62+
run: |
63+
branch=${GITHUB_REF##*/}
64+
sha=${GITHUB_SHA::8}
65+
ts=$(date +%s)
66+
release_tag=$(git describe --tags --exact-match --match 'v*' || echo "dirty")
67+
echo "BUILD_ID=${branch}-${sha}-${ts}" >> $GITHUB_ENV
68+
echo "RELEASE_BRANCH=${branch}" >> $GITHUB_ENV
69+
70+
- name: Configure AWS Credentials
71+
uses: aws-actions/configure-aws-credentials@v1
6072
with:
61-
name: binaries
62-
path: dist/
73+
role-to-assume: arn:aws:iam::006988687827:role/obp-argo-events-image-pusher
74+
aws-region: us-west-2
6375

64-
- name: Registry Login
65-
uses: docker/login-action@v2
66-
with:
67-
registry: quay.io
68-
username: ${{ secrets.QUAYIO_USERNAME }}
69-
password: ${{ secrets.QUAYIO_PASSWORD }}
76+
- run: aws sts get-caller-identity
7077

71-
- name: set Version
72-
id: version
73-
run: |
74-
tag=$(basename $GITHUB_REF)
75-
if [ $tag = "master" ]; then
76-
tag="latest"
77-
fi
78-
echo "VERSION=$tag" >> $GITHUB_OUTPUT
78+
- name: Login to ECR
79+
uses: docker/login-action@v1
80+
with:
81+
registry: ${{ env.ECR_REGISTRY }}
7982

80-
- name: Container build and push with arm64/amd64
81-
run: |
82-
IMAGE_NAMESPACE=${{ secrets.QUAYIO_ORG }} VERSION=${{ steps.version.outputs.VERSION }} DOCKER_PUSH=true make image-multi
83+
- name: Build and push Docker image
84+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
85+
with:
86+
platforms: linux/amd64,linux/arm64
87+
context: ./
88+
push: true
89+
build-args: |
90+
BUILD_ID=${{ env.BUILD_ID }}
91+
VERSION=${{ env.RELEASE_BRANCH }}
92+
secrets: |
93+
GH_ACCESS_TOKEN=${{ secrets.OBDEPLOYBOT_PAT }}
94+
tags: |
95+
${{env.ECR_REGISTRY}}/${{ env.IMAGE_NAME }}:${{ env.BUILD_ID }}
96+
${{env.ECR_REGISTRY}}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_BRANCH }}
97+
${{env.ECR_REGISTRY}}/${{ env.IMAGE_NAME }}:latest
8398
8499
bom:
85100
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)