Skip to content

Commit

Permalink
feat(ci): add docker builds for slinky sidecar and simapp (#174)
Browse files Browse the repository at this point in the history
* feat(ci): add docker builds for slinky sidecar and simapp

* fix: syntax error in workflow

* fix: name

* fix: indentation

* fix: dir name

* fix: repo url

---------

Co-authored-by: Alex Johnson <alex@skip.money>
  • Loading branch information
Zygimantass and aljo242 authored Feb 26, 2024
1 parent 87d1d3a commit 7af4906
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build Slinky docker images

on:
push:
branches:
- main
tags:
- "v.*"
pull_request:

jobs:
build:
strategy:
matrix:
image: [{file: "slinky.e2e.Dockerfile", name: "slinky-simapp"}, {file: "slinky.e2e.oracle.Dockerfile", name: "slinky-sidecar"}, {file: "slinky.local.Dockerfile", name: "slinky-testapp"}]
runs-on: ubuntu-latest
env:
registry_url: 494494944992.dkr.ecr.us-east-2.amazonaws.com/skip-mev/${{ matrix.image.name }}
repo_name: skip-mev/${{ matrix.image.name }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-region: us-east-2
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Create ECR repository if it does not exist
run: |
aws ecr describe-repositories --region us-east-2 --repository-names $repo_name || aws ecr create-repository --repository-name $repo_name --region us-east-2
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
${{ env.registry_url }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=semver,pattern={{major}}
type=sha,prefix=
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: "./contrib/images/${{ matrix.image.file }}"
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true

0 comments on commit 7af4906

Please sign in to comment.