Skip to content

Commit f5983bf

Browse files
authored
Build docker image (#25)
* fix: update * fix: cargo sort
1 parent ab75a89 commit f5983bf

File tree

3 files changed

+59
-7
lines changed

3 files changed

+59
-7
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build Container Images
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
service_config:
7+
description: 'Service configuration'
8+
required: true
9+
default: 'stake-deposit-interceptor-cranker'
10+
type: choice
11+
options:
12+
- stake-deposit-interceptor-cranker
13+
14+
env:
15+
REGISTRY: ghcr.io
16+
IMAGE_NAME: ${{ github.repository }}
17+
18+
jobs:
19+
build-container:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
29+
- name: Log in to Container Registry
30+
uses: docker/login-action@v3
31+
with:
32+
registry: ${{ env.REGISTRY }}
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Extract metadata
37+
id: meta
38+
uses: docker/metadata-action@v5
39+
with:
40+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
41+
tags: |
42+
type=raw,value=${{ github.ref_name }}-${{ github.event.inputs.service_config }}-{{sha}}
43+
type=raw,value=${{ github.ref_name }}-${{ github.event.inputs.service_config }}-latest
44+
45+
- name: Build and push container
46+
uses: docker/build-push-action@v5
47+
with:
48+
context: .
49+
file: ./cranker.Dockerfile
50+
platforms: linux/amd64
51+
push: true
52+
tags: ${{ steps.meta.outputs.tags }}
53+
labels: ${{ steps.meta.outputs.labels }}
54+
cache-from: type=gha
55+
cache-to: type=gha,mode=max

Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
[workspace]
2-
members = [
3-
"api",
4-
"stake_deposit_interceptor"
5-
]
2+
members = ["api", "stake_deposit_interceptor"]
63
exclude = ["cli", "cranker"]
74

85
[workspace.dependencies]

stake_deposit_interceptor/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name = "stake-deposit-interceptor"
33
version = "0.1.0"
44
edition = "2021"
55

6+
[lib]
7+
crate-type = ["cdylib", "lib"]
8+
69
[features]
710
no-entrypoint = []
811

@@ -29,6 +32,3 @@ solana-program-test = "2.0.14"
2932
solana-sdk = { workspace = true }
3033
solana-vote-program = "2.0.14"
3134
tokio = "1.41.0"
32-
33-
[lib]
34-
crate-type = ["cdylib", "lib"]

0 commit comments

Comments
 (0)