diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..f27f9e4 --- /dev/null +++ b/.github/workflows/docker.yml @@ -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 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5508486 --- /dev/null +++ b/Dockerfile @@ -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"] \ No newline at end of file diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 2b58b8b..135508e 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -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, } ); @@ -351,7 +351,7 @@ mod benches { [frame_system, SystemBench::] [pallet_balances, Balances] [pallet_timestamp, Timestamp] - [pallet_template, TemplateModule] + [pallet_template, UploadModule] ); }