Skip to content

Commit

Permalink
Merge pull request #263 from redpanda-data/PESDLC-1547-gha-use-aws-sm
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewhsu authored Jun 23, 2024
2 parents 4ad4177 + 5992092 commit cb1d978
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions .github/workflows/docker-image.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Build Docker image

on:
push:
tags:
Expand All @@ -8,49 +8,55 @@ on:
- "master"
paths-ignore:
- 'charts/**'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_SM_READONLY_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SM_READONLY_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: get secrets from aws sm
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: |
,sdlc/prod/github/dockerhub_token
parse-json-secrets: true
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
driver-opts: image=moby/buildkit:v0.10.3,network=host

- name: Set Release Date
run: |
echo "BUILT_AT=$(date --rfc-3339=date)" >> ${GITHUB_ENV}
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
vectorized/kminion
redpandadata/kminion
# generate Docker tags based on the following events/attributes
# Semver type is only active on 'push tag' events, hence no enable condition required
# Semver type is only active on 'push tag' events,
# hence no enable condition required
tags: |
type=sha,prefix={{branch}}-,format=short,enable={{is_default_branch}}
type=semver,pattern={{raw}}
- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

username: vectorizedbot
password: ${{ env.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
provenance: false
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.docker_meta.outputs.tags }}
Expand Down

0 comments on commit cb1d978

Please sign in to comment.