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

add pages deployment action #28

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build and Deploy

on:
workflow_dispatch:
release:
types: [published]

permissions:
contents: write

defaults:
run:
working-directory: bridge-frontend


jobs:
build-and-deploy:
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run: |
yarn
yarn build

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build # The folder the action should deploy.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ apt install -y --no-install-recommends \
ca-certificates=20230311ubuntu0.22.04.1 \
g++-riscv64-linux-gnu=4:11.2.0--1ubuntu1 \
wget=1.21.2-2ubuntu1 \
libclang-dev
libclang-dev \
libssl-dev pkg-config
EOF
# libclang needed to build rocksdb. Can remove once this is no longer needed.
# libssl-dev and pkg-config needed to use reqwest

RUN set -eux; \
dpkgArch="$(dpkg --print-architecture)"; \
Expand Down
5 changes: 4 additions & 1 deletion fullnode.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ apt install -y --no-install-recommends \
build-essential=12.9ubuntu3 \
ca-certificates=20230311ubuntu0.22.04.1 \
wget=1.21.2-2ubuntu1 \
libclang-dev
libclang-dev \
libssl-dev pkg-config
EOF
# libclang needed to build rocksdb. Can remove once this is no longer needed.
# libssl-dev and pkg-config needed to use reqwest

RUN set -eux; \
dpkgArch="$(dpkg --print-architecture)"; \
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async fn main() -> Result<(), anyhow::Error> {
.expect("Failed to start the rollup server");

#[cfg(feature = "listen-graphql")]
tower_cartesi::listen_graphql(&mut cartezcash_app, &server_addr, 10)
tower_cartesi::listen_graphql(&mut cartezcash_app, &server_addr, 10, std::time::Duration::from_secs(5))
.await
.expect("Failed to start the rollup server");

Expand Down
1 change: 1 addition & 0 deletions tower-cartesi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ reqwest = { version = "0.12.3", features = ["json"] }
serde = { version = "1.0.197", features = ["derive"] }
serde_json = "1.0.115"
thiserror = "1.0.58"
tokio = { version = "1.32", features = ["time"] }
tower-service = "0.3.2"
tracing = "0.1.40"

Expand Down
6 changes: 5 additions & 1 deletion tower-cartesi/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use thiserror::Error;
use tower_service::Service;
use tokio::time::interval;

mod messages;
mod request;
Expand Down Expand Up @@ -74,14 +75,16 @@ pub async fn listen_graphql<S>(
service: &mut S,
host_uri: &str,
page_size: usize,
frequency: std::time::Duration,
) -> Result<(), Error<S::Error>>
where
S: Service<Request, Response = Response>,
{
// let client = hyper::Client::new();
let client = reqwest::Client::new();
let mut cursor = None;

let mut interval = interval(frequency);

loop {
let request_body = InputsQuery::build_query(inputs_query::Variables {
first: page_size as i64,
Expand All @@ -97,5 +100,6 @@ where
.await
.map_err(Error::ServiceError)?;
}
interval.tick().await;
}
}
Loading