Skip to content

Commit

Permalink
chore(ci): fix proto inclusion and updates (#38)
Browse files Browse the repository at this point in the history
Description
Fix proto file inclusion
Update CI and node base docker image
Remove older comments

Motivation and Context
Fix and improve the docker image

How Has This Been Tested?
Build and run in local fork
  • Loading branch information
leet4tari authored Sep 13, 2024
2 parents aa3e47c + 43eda45 commit 07c87fe
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 10 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/build_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,23 @@ env:
# TARI_BRANCH: development
# TARI_BRANCH: stagenet
DOCKER_IMAGE: minotari_text_explorer
DAYS_to_EXPIRE: 30

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions: {}

jobs:
docker_build:
name: Docker building
strategy:
fail-fast: false

permissions:
packages: write

runs-on: ubuntu-latest

steps:
Expand All @@ -59,6 +65,12 @@ jobs:
with:
path: tari-explorer

- name: Setup expiration for scheduled builds
if: ${{ github.event_name == 'schedule' && github.event.schedule == '05 00 * * *' }}
shell: bash
run: |
echo "EXPIRATION=${{ env.DAYS_to_EXPIRE }}d" >> $GITHUB_ENV
- name: Prep for branch
shell: bash
run: |
Expand Down Expand Up @@ -114,6 +126,7 @@ jobs:
ref: development
sparse-checkout: |
clients/nodejs/base_node_grpc_client/src/index.js
applications/minotari_app_grpc/proto/
sparse-checkout-cone-mode: false
path: tari-project-tari

Expand All @@ -123,6 +136,7 @@ jobs:
run: |
ls -alht
cp -fv tari-project-tari/clients/nodejs/base_node_grpc_client/src/index.js tari-explorer/external_libs/base_node_grpc_client/src
cp -fvr tari-project-tari/applications/minotari_app_grpc/proto tari-explorer/external_libs/base_node_grpc_client/src/proto
head -n15 tari-explorer/external_libs/base_node_grpc_client/src/index.js
- name: Set up QEMU for Docker
Expand All @@ -136,11 +150,6 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
#name/${{ env.DOCKER_IMAGE }}
#name/${{ github.repository }}
#ghcr.io/${{ github.repository }}
#ghcr.io/${{ github.repository_owner }}/${{ github.repository }}
#ghcr.io/${{ github.repository_owner }}
ghcr.io/${{ github.repository_owner }}/${{ env.DOCKER_IMAGE }}
${{ secrets.DOCKER_PROVIDER }}/${{ secrets.DOCKER_REPO }}/${{ env.DOCKER_IMAGE }}
tags: |
Expand All @@ -152,8 +161,7 @@ jobs:
type=sha
labels: |
maintainer=${{ github.actor }}
quay.expires-after=60d
#org.opencontainers.image.title=MyCustomTitle
quay.expires-after=${{ env.EXPIRATION }}
org.opencontainers.image.description=Minotari Text Explorer
org.opencontainers.image.vendor=TariLabs
Expand All @@ -166,8 +174,6 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to Docker Image Provider
# Debug
# if: ${{ false }}
uses: docker/login-action@v3
with:
registry: ${{ secrets.DOCKER_PROVIDER }}
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/pr_signed_commits_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
# Checks if the comments are signed or not
name: PR - Signed commits check

'on':
pull_request_target

concurrency:
# https://docs.github.com/en/actions/examples/using-concurrency-expressions-and-a-test-matrix
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/v') || github.ref != 'refs/heads/development' || github.ref != 'refs/heads/nextnet' || github.ref != 'refs/heads/stagenet' }}

permissions: {}

jobs:
check-signed-commits:
name: Check signed commits in PR
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Check signed commits in PR
uses: 1Password/check-signed-commits-action@v1
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax = docker/dockerfile:1.3

# https://hub.docker.com/_/node
ARG NODE_VERSION=16-bullseye-slim
ARG NODE_VERSION=22-bookworm-slim

FROM node:$NODE_VERSION

Expand All @@ -18,6 +18,8 @@ COPY --chown=node:node . .
#RUN npm ci --only=production --omit=dev
RUN npm install ${EXTERNAL_LIBS_LOCATION}/base_node_grpc_client/
RUN npm install
# Hack - bring proto files in
RUN cp -fvr ${EXTERNAL_LIBS_LOCATION}/base_node_grpc_client/proto node_modules/\@tariproject/base-node-grpc-client/proto
#RUN npm install debug

ENV BASE_NODE_PROTO=${BASE_NODE_PROTO}
Expand Down

0 comments on commit 07c87fe

Please sign in to comment.