Skip to content

Commit 42402d2

Browse files
committed
ci(build): add docker build workflow
Also remove docker build step from Drone
1 parent 2c7cc12 commit 42402d2

File tree

2 files changed

+57
-63
lines changed

2 files changed

+57
-63
lines changed

.drone.yml

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -206,66 +206,3 @@ steps:
206206
echo "NON_LOCAL_COMMITMENTS=$$NON_LOCAL_COMMITMENTS"
207207
assert 'non-local commintment exists' '[ $$NON_LOCAL_COMMITMENTS -gt 0 ]'
208208
209-
---
210-
kind: pipeline
211-
type: docker
212-
name: build-pr-docker-image
213-
214-
trigger:
215-
branch:
216-
- develop
217-
events:
218-
- pull_request
219-
220-
steps:
221-
- name: submodules
222-
image: alpine/git
223-
environment:
224-
GITHUB_AUTH_TOKEN:
225-
from_secret: github_auth_token
226-
commands:
227-
- git config --global url."https://$${GITHUB_AUTH_TOKEN}:@github.com/".insteadOf "https://github.com/"
228-
- git config --global --add safe.directory /drone/src
229-
- git config --global --add safe.directory /drone/src/ledger
230-
- git config --global --add safe.directory /drone/src/mina-p2p-messages-rs
231-
- git config --global --add safe.directory /drone/src/deps/algebra
232-
- git config --global --add safe.directory /drone/src/deps/proof-systems
233-
- git config --global --add safe.directory /drone/src/deps/redux-rs
234-
- git submodule update --init --recursive
235-
- rm ~/.gitconfig
236-
237-
- name: build-image-pr
238-
image: plugins/docker
239-
settings:
240-
build_args:
241-
- MINA_SNARK_WORKER_IMAGE=openmina/mina-snark-worker-proover:0.0.9
242-
username:
243-
from_secret: docker_hub_username
244-
password:
245-
from_secret: docker_hub_password
246-
repo: openmina/openmina
247-
tags:
248-
- ${DRONE_SOURCE_BRANCH//\//-}-${DRONE_COMMIT_SHA:0:8}
249-
- ${DRONE_SOURCE_BRANCH//\//-}-latest
250-
when:
251-
event:
252-
- pull_request
253-
254-
- name: build-image
255-
image: plugins/docker
256-
settings:
257-
build_args:
258-
- MINA_SNARK_WORKER_TAG=0.0.9
259-
username:
260-
from_secret: docker_hub_username
261-
password:
262-
from_secret: docker_hub_password
263-
repo: openmina/openmina
264-
tags:
265-
- ${DRONE_COMMIT_SHA:0:8}
266-
- latest
267-
when:
268-
branch:
269-
- develop
270-
event:
271-
- push

.github/workflows/docker.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Openmina Docker Build
2+
on:
3+
workflow_dispatch: {}
4+
push:
5+
branches: [ main, develop ]
6+
paths-ignore:
7+
# - ".github/**"
8+
- ".drone.yml"
9+
- "helm/**"
10+
- "*.md"
11+
- "docs/**"
12+
pull_request:
13+
branches: [ main, develop ]
14+
paths-ignore:
15+
# - ".github/**"
16+
- ".drone.yml"
17+
- "helm/**"
18+
- "*.md"
19+
- "docs/**"
20+
21+
22+
23+
jobs:
24+
docker-build:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Git checkout
28+
uses: actions/checkout@v3
29+
30+
- name: Login to Docker Hub
31+
uses: docker/login-action@v3
32+
with:
33+
username: ${{ secrets.DOCKERHUB_USERNAME }}
34+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
35+
36+
- name: Set up Docker Buildx
37+
uses: docker/setup-buildx-action@v3
38+
39+
- name: Docker meta
40+
id: meta
41+
uses: docker/metadata-action@v5
42+
with:
43+
# list of Docker images to use as base name for tags
44+
images: |
45+
openmina/openmina
46+
# generate Docker tags based on the following events/attributes
47+
tags: |
48+
type=ref,event=branch
49+
type=sha,format=short
50+
51+
- name: Build and push
52+
uses: docker/build-push-action@v5
53+
with:
54+
push: true
55+
tags: ${{ steps.meta.outputs.tags }}
56+
cache-from: type=gha
57+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)