From f06785adbe630ca2557e149d4385a194fe0b53e0 Mon Sep 17 00:00:00 2001 From: Joshy Orndorff Date: Tue, 27 Jun 2023 12:10:56 -0400 Subject: [PATCH] some basic-ci --- .github/workflows/build.yml | 4 +-- .github/workflows/docker.yml | 37 +----------------------- .github/workflows/links.yml | 8 +++++- .github/workflows/rustdocs.yml | 52 ---------------------------------- Dockerfile | 2 +- 5 files changed, 11 insertions(+), 92 deletions(-) delete mode 100644 .github/workflows/rustdocs.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b48aee67d..a692f6e33 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,10 +1,10 @@ on: pull_request: branches: - - main + - dex-tutorial push: branches: - - main + - dex-tutorial name: Continuous integration diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9004c942b..c7ca7429a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,14 +1,11 @@ # Workflow inspired by https://docs.github.com/en/actions/publishing-packages/publishing-docker-images -# I'm choosing to publish on github container registry as opposed to docker hub for two reasons -# 1. It feels less official and these containers are not yet ready for production -# 2. It doesn't require setting up a docker hub account or encrypting secrets. - name: Create and publish a Docker image on: push: branches: + # TODO consider enabling for dex tutorial solution - main tags: - '**' @@ -48,35 +45,3 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - - build-and-push-wallet-image: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Log in to the Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-wallet - - - name: Build and push Docker image - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc - with: - file: ./wallet/Dockerfile - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index 7fb7e430c..82f1dfc33 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -1,6 +1,12 @@ name: Check Markdown Links -on: [push] +on: + pull_request: + branches: + - dex-tutorial + push: + branches: + - dex-tutorial jobs: markdown-link-check: diff --git a/.github/workflows/rustdocs.yml b/.github/workflows/rustdocs.yml deleted file mode 100644 index 98d2d1e44..000000000 --- a/.github/workflows/rustdocs.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Publish Rust Docs - -on: - push: - branches: - - main - -# So github actions runner can publish the built docs to the gh-pages branch -permissions: - contents: write - -jobs: - deploy-docs: - name: Deploy docs - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v1 - - - name: Install tooling - run: | - sudo apt-get install -y protobuf-compiler - protoc --version - - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - target: wasm32-unknown-unknown - override: true - - - name: Build rustdocs - uses: actions-rs/cargo@v1 - env: - CARGO_INCREMENTAL: "0" - with: - command: doc - args: --all --no-deps - - # Make an index.html file so we start at the tuxedo core - # Copied from https://github.com/substrate-developer-hub/rustdocs/blob/master/index.html - - name: Make index.html - run: echo "" > ./target/doc/index.html - - - name: Deploy documentation - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_branch: gh-pages - publish_dir: ./target/doc diff --git a/Dockerfile b/Dockerfile index 6edcb0107..2bebdc0fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ RUN cargo build --locked --release # Alpine does't work as explained https://stackoverflow.com/a/66974607/4184410 # Also, surprisingly, `ubuntu:latest` doesn't work and leads to "OS can't spawn worker thread: Operation not permitted" FROM docker.io/library/ubuntu:20.04 -LABEL description="Tuxedo Node Template" +LABEL description="Tuxedo Order Book Dex Tutorial" COPY --from=builder /node-template/target/release/node-template /usr/local/bin