Skip to content

Commit d0e5e6b

Browse files
authored
Merge pull request #456 from autonomys/gh_action_node_utils
add github actions for node-utils docker build
2 parents 5eb6db0 + 02d5f16 commit d0e5e6b

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/docker_build.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# This action enables building container images with manual trigger/
2+
#
3+
# Container images are only pushed to GitHub Container Registry for releases.
4+
name: Docker build
5+
6+
on:
7+
workflow_dispatch:
8+
9+
# Incremental compilation here isn't helpful
10+
env:
11+
CARGO_INCREMENTAL: 0
12+
13+
jobs:
14+
build:
15+
runs-on: [ ubuntu-latest ]
16+
permissions:
17+
contents: read
18+
packages: write
19+
strategy:
20+
matrix:
21+
build:
22+
- image: node-utils
23+
docker-file: modules/node-utils/Dockerfile
24+
fail-fast: false
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
29+
30+
- name: Docker meta
31+
id: meta
32+
uses: docker/metadata-action@v3
33+
with:
34+
images: |
35+
ghcr.io/${{ github.repository }}/${{ matrix.build.image }}
36+
tags: |
37+
type=raw,value=latest
38+
39+
- name: Log into registry
40+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
41+
with:
42+
registry: ghcr.io
43+
username: ${{ github.actor }}
44+
password: ${{ github.token }}
45+
46+
- name: Set up QEMU
47+
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
48+
49+
- name: Set up Docker Buildx
50+
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
51+
52+
- name: Build and push ${{ matrix.build.image }} image
53+
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
54+
with:
55+
file: ${{ matrix.build.docker-file }}
56+
platforms: linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/arm64
57+
push: true
58+
tags: ${{ steps.meta.outputs.tags }}
59+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)