Skip to content

Commit 943c028

Browse files
authored
Add Docker build workflow for GitHub Actions
1 parent a789ced commit 943c028

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/docker.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Docker Build
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
tags: [ 'v*' ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
env:
11+
REGISTRY: europe-west4-docker.pkg.dev
12+
PROJECT_ID: bridge-misc
13+
REPOSITORY: omni-bridge-docker-images
14+
15+
16+
jobs:
17+
build:
18+
runs-on: warp-ubuntu-latest-x64-2x
19+
permissions:
20+
contents: read
21+
packages: write
22+
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Authenticate to Google Cloud
28+
uses: google-github-actions/auth@v2
29+
with:
30+
credentials_json: ${{ secrets.GCP_SA_KEY }}
31+
32+
- name: Configure Docker to use gcloud as credential helper
33+
run: gcloud auth configure-docker ${{ env.REGISTRY }}
34+
35+
- name: Extract metadata
36+
id: meta
37+
uses: docker/metadata-action@v5
38+
with:
39+
images: ${{ env.REGISTRY }}/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/bitcoin-augur-reference
40+
tags: |
41+
type=ref,event=branch
42+
type=ref,event=pr
43+
type=semver,pattern={{version}}
44+
type=semver,pattern={{major}}.{{minor}}
45+
type=sha
46+
47+
- name: Build and push
48+
uses: Warpbuilds/build-push-action@v6
49+
with:
50+
context: .
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

0 commit comments

Comments
 (0)