From 3521209a6281e8536c54247066ed6e5909b13aff Mon Sep 17 00:00:00 2001 From: Ben Wilson Date: Wed, 13 Dec 2023 12:05:36 -0500 Subject: [PATCH] Feature: Add workflow to build images on demand --- .github/workflows/on-demand-build-images.yaml | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/on-demand-build-images.yaml diff --git a/.github/workflows/on-demand-build-images.yaml b/.github/workflows/on-demand-build-images.yaml new file mode 100644 index 00000000..88c0674d --- /dev/null +++ b/.github/workflows/on-demand-build-images.yaml @@ -0,0 +1,40 @@ +name: On demand Docker Image Build + +on: + workflow_dispatch: + inputs: + tag_name: + required: true + description: "Tag name will be prefaced with 'on-demand-'." + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Login to Public ECR + uses: docker/login-action@v2 + with: + registry: public.ecr.aws + username: ${{ secrets.AWS_ACCESS_KEY_ID }} + password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + env: + AWS_REGION: us-east-1 + - name: Set Final Tag + run: echo "TAG=on-demand-${{ inputs.tag_name }}" >> .env + + - name: Build Docker Image + run: | + docker buildx build --load -t 3box/keramik-runner:$TAG --target runner . + docker push public.ecr.aws/r5b3e0r5/3box/keramik-runner:$TAG + + - name: Build Docker Image + run: | + docker buildx build --load -t 3box/keramik-operator:$TAG --target operator . + docker push public.ecr.aws/r5b3e0r5/3box/keramik-operator:$TAG + + - name: Print Image ID + run: | + echo public.ecr.aws/r5b3e0r5/3box/keramik-runner:$TAG + echo public.ecr.aws/r5b3e0r5/3box/keramik-operator:$TAG +