Skip to content

fix: Correctly handle all HTTP responses #1187

fix: Correctly handle all HTTP responses

fix: Correctly handle all HTTP responses #1187

Workflow file for this run

name: Build Slinky docker images
on:
push:
branches:
- main
tags:
- "v.*"
pull_request:
workflow_dispatch:
jobs:
build:
strategy:
matrix:
image: [{file: "slinky.e2e.Dockerfile", name: "slinky-simapp"}, {file: "slinky.sidecar.prod.Dockerfile", name: "slinky-sidecar"}, {file: "slinky.local.Dockerfile", name: "slinky-testapp"},
{file: "slinky.sidecar.e2e.Dockerfile", name: "slinky-e2e-sidecar"}]
runs-on: ubuntu-latest-m
permissions:
contents: read
packages: write
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@v4
- name: Configure AWS Credentials
uses: aws-actions/[email protected]
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: Log in to the Container registry
uses: docker/login-action@5f4866a30a54f16a52d2ecb4a3898e9e424939cf
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- 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 }}
ghcr.io/skip-mev/${{ matrix.image.name }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern=v{{major}}.{{minor}}.{{patch}}
type=semver,pattern=v{{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
platforms: ${{ startsWith(github.ref, 'refs/tags/v') && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
- uses: cloudposse/[email protected]
id: out
with:
matrix-step-name: github-action-matrix-outputs-read
matrix-key: ${{ matrix.image.name }}
outputs: |-
image: ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
deploy:
needs: [build]
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Check out the repo
uses: actions/checkout@v4
- uses: supplypike/setup-bin@v4
with:
uri: 'https://releases.hashicorp.com/levant/0.3.2/levant_0.3.2_linux_amd64.zip'
name: 'levant'
version: 'v0.3.2'
- name: Connect to Tailnet
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TAILSCALE_ID }}
oauth-secret: ${{ secrets.TAILSCALE_SECRET }}
tags: tag:githubactions
- uses: cloudposse/github-action-matrix-outputs-read@main
id: matrix_output
with:
matrix-step-name: github-action-matrix-outputs-read
- name: Deploy image to Nomad
env:
NOMAD_ADDR: ${{ secrets.NOMAD_ADDR }}
run: make CHAIN_IMAGE=${{ fromJSON(steps.matrix_output.outputs.result).image['slinky-testapp'] }} SIDECAR_IMAGE=${{ fromJSON(steps.matrix_output.outputs.result).image['slinky-e2e-sidecar'] }} deploy-dev