Skip to content

deploy-profiling

deploy-profiling #29

name: deploy-profiling
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag suffix for the profiling image (e.g., "profiling" or "profiling-v1.2.3")'
required: false
default: 'profiling'
jobs:
deploy-profiling:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
# Without this the fetch depth defaults to 1, which only includes the most recent commit. We want to know the full history so that `git describe` can give more information when it is invoked in the orderbook's crate build script.
fetch-depth: '0'
persist-credentials: false
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set image tag
id: tag
run: |
if [ -n "${{ github.event.inputs.tag }}" ]; then
echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
else
echo "tag=profiling" >> $GITHUB_OUTPUT
fi
echo "sha_tag=profiling-${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
- name: Profiling services image metadata
id: meta_services
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,value=${{ steps.tag.outputs.tag }}
type=raw,value=${{ steps.tag.outputs.sha_tag }}
labels: |
org.opencontainers.image.licenses=GPL-3.0-or-later
org.opencontainers.image.description=CoW Protocol Services with jemalloc profiling enabled
- name: Profiling services image build
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.meta_services.outputs.tags }}
labels: ${{ steps.meta_services.outputs.labels }}
build-args: |
CARGO_BUILD_FEATURES=--features jemalloc-profiling
- name: Profiling migration image metadata
id: meta_migration
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
with:
images: ghcr.io/${{ github.repository }}-migration
tags: |
type=raw,value=${{ steps.tag.outputs.tag }}
type=raw,value=${{ steps.tag.outputs.sha_tag }}
labels: |
org.opencontainers.image.licenses=GPL-3.0-or-later
- name: Profiling migration image build
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
file: Dockerfile
target: migrations
push: true
tags: ${{ steps.meta_migration.outputs.tags }}
labels: ${{ steps.meta_migration.outputs.labels }}