Skip to content

Commit 02ce69e

Browse files
authored
GHA for building and releasing improvements (#446)
* release tags and every commit from branches * change to file * setup buildx * use bullseye
1 parent d05ec4b commit 02ce69e

File tree

2 files changed

+38
-8
lines changed

2 files changed

+38
-8
lines changed

.github/workflows/hyperspace-docker-image.yml

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,27 @@ name: "Build and publish Hyperspace Docker image"
33
on:
44
push:
55
branches:
6-
- master
6+
- '*'
7+
tags:
8+
- 'v*'
9+
10+
env:
11+
IMAGE_NAME: ${{ github.repository }}
712

813
jobs:
14+
915
build-and-publish:
16+
17+
name: Build & push docker image
18+
1019
runs-on:
1120
- self-hosted
1221
- x64-monster
22+
1323
concurrency:
1424
group: hyperspace-docker-image-${{ github.ref }}
1525
cancel-in-progress: true
26+
1627
strategy:
1728
fail-fast: true
1829

@@ -31,14 +42,33 @@ jobs:
3142
with:
3243
fetch-depth: 0
3344

45+
- name: Set up QEMU
46+
uses: docker/setup-qemu-action@v3
47+
48+
- name: Set up Docker Buildx
49+
uses: docker/setup-buildx-action@v3
50+
51+
- name: Extract metadata (tags, labels) for Docker
52+
id: meta
53+
uses: docker/metadata-action@v5
54+
with:
55+
images: ${{ env.IMAGE_NAME }}
56+
tags: |
57+
type=semver,pattern={{version}}
58+
type=semver,pattern={{major}}.{{minor}}
59+
type=ref,event=branch
60+
type=sha,prefix={{branch}}-
61+
3462
- name: Login to Docker Hub
3563
uses: docker/login-action@v2
3664
with:
3765
username: ${{ secrets.DOCKER_HUB_USERNAME }}
3866
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
3967

40-
- name: Build Docker image
41-
run: make -f hyperspace/Makefile build-docker-image-hyperspace
42-
43-
- name: Docker push
44-
run: make -f hyperspace/Makefile publish-docker-image-hyperspace
68+
- name: Build and push Docker image
69+
uses: docker/build-push-action@v5
70+
with:
71+
file: scripts/hyperspace.Dockerfile
72+
push: ${{ github.event_name != 'pull_request' }}
73+
tags: ${{ steps.meta.outputs.tags }}
74+
labels: ${{ steps.meta.outputs.labels }}

scripts/hyperspace.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM paritytech/ci-unified:bullseye-1.71.0-v20230727 as builder
1+
FROM paritytech/ci-unified:bullseye-1.73.0-2023-05-23 as builder
22

33
WORKDIR /code
44

@@ -14,7 +14,7 @@ RUN cargo build --release --locked -p hyperspace
1414

1515
# =============
1616

17-
FROM debian:buster-slim
17+
FROM debian:bullseye-slim
1818

1919
RUN useradd -m -u 1000 -U -s /bin/sh -d /centauri centauri
2020

0 commit comments

Comments
 (0)