Skip to content

Commit

Permalink
Build & publish docker image as part of release CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kacperzuk-neti committed May 9, 2024
1 parent 65ee403 commit 39d0ae7
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 5 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build & publish Docker image

on:
release:
types: [released]

jobs:
build-and-publish-docker:
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker Image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile-prebuilt
push: true
build-args: VERSION=tags/${{ github.ref_name }}
tags: ghcr.io/liberland/blockchain-node:${{ github.ref_name }},ghcr.io/liberland/blockchain-node:latest
2 changes: 1 addition & 1 deletion Dockerfile-prebuilt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN curl -sSL https://api.github.com/repos/liberland/liberland_substrate/release
RUN curl -sSL "$(jq -r '.assets[] | select(.name == "linux_x86_build") | .browser_download_url' < relinfo)" -o node

FROM debian:bullseye-slim
EXPOSE 30333 9933 9944
EXPOSE 30333 9944
VOLUME /data
RUN useradd -Ms /bin/bash liberland
COPY --from=downloader /app/node /node
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-source
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COPY substrate/ .
RUN cargo build --release

FROM debian:buster-slim AS runtime
EXPOSE 30333 9933 9944
EXPOSE 30333 9944
VOLUME /data
COPY --from=builder /app/target/release/substrate /node
COPY substrate/specs /specs
Expand Down
4 changes: 2 additions & 2 deletions substrate/bin/node/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "node-cli"
version = "3.0.0-dev"
version = "21.0.0"
authors.workspace = true
description = "Generic Substrate node implementation in Rust."
description = "Liberland node implementation in Rust."
build = "build.rs"
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
Expand Down
2 changes: 1 addition & 1 deletion substrate/bin/node/runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kitchensink-runtime"
version = "3.0.0-dev"
version = "21.0.0"
authors.workspace = true
description = "Substrate node kitchensink runtime."
edition.workspace = true
Expand Down

0 comments on commit 39d0ae7

Please sign in to comment.