Skip to content

Commit

Permalink
Push flow-aggregator image to ghcr.io registry (#7036)
Browse files Browse the repository at this point in the history
As an alternative to docker.io
This is the same change that we did previously for the "main" Antrea
images (antrea-agent-ubuntu and antrea-controller-ubuntu).

Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>
  • Loading branch information
antoninbas authored Mar 5, 2025
1 parent 7a8982f commit 05f146d
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 14 deletions.
39 changes: 32 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -255,23 +255,48 @@ jobs:
build-flow-aggregator:
needs: check-env
if: ${{ needs.check-env.outputs.has_changes == 'yes' || github.event_name == 'push' }}
runs-on: [ubuntu-latest]
runs-on: ubuntu-latest
env:
DOCKER_TAG: latest
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: ${{ needs.check-env.outputs.docker_driver }}
- name: Build flow-aggregator Docker image
run: make flow-aggregator-image
- name: Check flow-aggregator Docker image
run: docker run antrea/flow-aggregator --version
- name: Push flow-aggregator Docker image to registry
- name: Login to Docker Hub
if: ${{ needs.check-env.outputs.push_needed == 'true' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to Github Container Registry
if: ${{ needs.check-env.outputs.push_needed == 'true' }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push flow-aggregator Docker image to registries
if: ${{ needs.check-env.outputs.push_needed == 'true' }}
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker push antrea/flow-aggregator:latest
targets=(
"docker.io antrea"
"ghcr.io antrea-io"
)
for target in "${targets[@]}"; do
t=($target)
registry="${t[0]}"
namespace="${t[1]}"
docker tag antrea/flow-aggregator:"${DOCKER_TAG}" ${registry}/${namespace}/flow-aggregator:"${DOCKER_TAG}"
docker push ${registry}/${namespace}/flow-aggregator:"${DOCKER_TAG}"
done
build-antrea-migrator:
needs: check-env
Expand Down
41 changes: 34 additions & 7 deletions .github/workflows/build_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ jobs:
show-progress: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker
- name: Build and push Antrea UBI9 amd64 Docker images to registry
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
Expand Down Expand Up @@ -194,19 +196,44 @@ jobs:
docker push antrea/antrea-mc-controller:"${VERSION}"
build-flow-aggregator:
runs-on: [ubuntu-latest]
needs: get-version
runs-on: ubuntu-latest
env:
DOCKER_TAG: ${{ needs.get-version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.get-version.outputs.antrea_ref }}
show-progress: false
- name: Build flow-aggregator Docker image and push to registry
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker
- name: Build flow-aggregator Docker image
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
VERSION: ${{ needs.get-version.outputs.version }}
run: make flow-aggregator-image
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to Github Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push flow-aggregator Docker image to registries
run: |
make flow-aggregator-image
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker push antrea/flow-aggregator:"${VERSION}"
targets=(
"docker.io antrea"
"ghcr.io antrea-io"
)
for target in "${targets[@]}"; do
t=($target)
registry="${t[0]}"
namespace="${t[1]}"
docker tag antrea/flow-aggregator:"${DOCKER_TAG}" ${registry}/${namespace}/flow-aggregator:"${DOCKER_TAG}"
docker push ${registry}/${namespace}/flow-aggregator:"${DOCKER_TAG}"
done

0 comments on commit 05f146d

Please sign in to comment.