Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create docker github actions #1

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
34 changes: 34 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Docker Image CI

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
# - name: Login and Build the Docker image
# run: |
# echo $CR_PAT | docker login ghcr.io -u ${{ github.actor }} --password-stdin
# env:
# CR_PAT: ${{ secrets.PAT }}
# docker image build -t nusic/layer1:v1 .
# docker push nusic/layer1:v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: nusic-fm
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build the Docker image
run: |
docker build -t ghcr.io/nusic-fm/layer1:v1.2 .
docker push ghcr.io/nusic-fm/layer1:v1.2

# docker run ghcr.io/nusic-fm/layer1:v1.1
48 changes: 48 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# FROM rust:buster as builder
# WORKDIR /app

# RUN rustup default nightly-2022-02-19 && \
# rustup target add wasm32-unknown-unknown --toolchain nightly-2022-02-19

# RUN apt-get update && \
# apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold" && \
# apt-get install -y cmake pkg-config libssl-dev git clang libclang-dev

# COPY . .

# RUN cargo build --release && ./target/release/node-template --dev --ws-external

# ENTRYPOINT ["tail", "-f", "/dev/null"]

# # =============

FROM rustlang/rust:nightly

WORKDIR /app

RUN apt-get update -y && \
apt-get install -y cmake pkg-config libssl-dev git gcc build-essential clang libclang-dev

RUN rustup target add wasm32-unknown-unknown
# /app/target/release/node-template --dev --ws-external

COPY . .

RUN cargo build --release

LABEL org.opencontainers.image.source="https://github.com/nusic-fm/metadata-layer"

# ENV environment dev
# ENV place ws-external

# CMD ["/app/target/release/node-template"]

# CMD ["sh", "-c", "/app/target/release/node-template --${environment} --${place}"]

EXPOSE 9944

ENTRYPOINT ["/app/target/release/node-template"]

# && ./target/release/node-template --dev --ws-external

# ENTRYPOINT ["tail", "-f", "/dev/null"]
4 changes: 2 additions & 2 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ construct_runtime!(
TransactionPayment: pallet_transaction_payment,
Sudo: pallet_sudo,
// Include the custom logic from the pallet-template in the runtime.
TemplateModule: pallet_template,
UploadModule: pallet_template,
}
);

Expand Down Expand Up @@ -351,7 +351,7 @@ mod benches {
[frame_system, SystemBench::<Runtime>]
[pallet_balances, Balances]
[pallet_timestamp, Timestamp]
[pallet_template, TemplateModule]
[pallet_template, UploadModule]
);
}

Expand Down