Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish nightly and release Docker images to public ECR #2465

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 29 additions & 19 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,63 @@ name: nightly
on:
schedule:
- cron: '30 3 * * *'
workflow_dispatch: {}

jobs:
build-push-images:
environment: 'Docker Push'
runs-on: ubuntu-latest
steps:
- name: Add standard tags
run: |
echo 'TAGS_STANDARD<<EOF' >> $GITHUB_ENV
echo 'type=schedule,pattern=nightly' >> $GITHUB_ENV
echo "type=schedule,pattern={{date 'YYYY-MM-DD'}}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Add Red Hat standard tags
run: |
echo 'REDHAT_STANDARD<<EOF' >> $GITHUB_ENV
echo 'type=schedule,pattern=nightly,suffix=-redhat' >> $GITHUB_ENV
echo "type=schedule,pattern={{date 'YYYY-MM-DD'}},suffix=-redhat" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Login to Public ECR
uses: docker/login-action@v1
with:
registry: public.ecr.aws
username: ${{ secrets.AWS_ECR_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_ECR_SECRET_ACCESS_KEY }}
env:
AWS_REGION: us-east-1

- name: Docker meta
id: meta
uses: docker/[email protected]
with:
images: kong/nightly-ingress-controller
tags: ${{ env.TAGS_STANDARD }}
images: |
kong/nightly-ingress-controller
public.ecr.aws/kong/nightly-ingress-controller
tags: |
type=schedule,pattern=nightly
type=schedule,pattern={{date 'YYYY-MM-DD'}}

- name: Docker meta (redhat)
id: meta_redhat
uses: docker/[email protected]
with:
images: kong/nightly-ingress-controller
flavor: |
latest=false
tags: ${{ env.REDHAT_STANDARD }}
images: |
kong/nightly-ingress-controller
public.ecr.aws/kong/nightly-ingress-controller
tags: |
type=schedule,pattern=nightly,suffix=-redhat
type=schedule,pattern={{date 'YYYY-MM-DD'}},suffix=-redhat

- name: Build binary
id: docker_build_binary
uses: docker/build-push-action@v2
Expand All @@ -66,6 +74,7 @@ jobs:
TAG=${{ steps.meta.outputs.version }}
COMMIT=${{ github.sha }}
REPO_INFO=https://github.com/${{ github.repository }}.git

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
Expand All @@ -80,6 +89,7 @@ jobs:
TAG=${{ steps.meta.outputs.version }}
COMMIT=${{ github.sha }}
REPO_INFO=https://github.com/${{ github.repository }}.git

- name: Build and push Red Hat
id: docker_build_redhat
env:
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,31 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Login to Public ECR
uses: docker/login-action@v1
with:
registry: public.ecr.aws
username: ${{ secrets.AWS_ECR_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_ECR_SECRET_ACCESS_KEY }}
env:
AWS_REGION: us-east-1
- name: Docker meta
id: meta
uses: docker/[email protected]
with:
images: kong/kubernetes-ingress-controller
images: |
kong/nightly-ingress-controller
public.ecr.aws/kong/nightly-ingress-controller
flavor: |
latest=${{ github.event.inputs.latest == 'true' }}
tags: ${{ env.TAGS_STANDARD }}${{ env.TAGS_SUPPLEMENTAL }}
- name: Docker meta (redhat)
id: meta_redhat
uses: docker/[email protected]
with:
images: kong/kubernetes-ingress-controller
images: |
kong/nightly-ingress-controller
public.ecr.aws/kong/nightly-ingress-controller
flavor: |
latest=false
tags: ${{ env.REDHAT_STANDARD }}${{ env.REDHAT_SUPPLEMENTAL }}
Expand Down