From 855e7c6969619775569f6268169e8392a4f9a9ea Mon Sep 17 00:00:00 2001 From: Conor Schaefer Date: Wed, 25 Oct 2023 13:46:04 -0700 Subject: [PATCH] ci: build cuiloa container --- .github/workflows/containers.yml | 39 ++++++++++++++++++++ .github/workflows/deploy-preview.yml | 3 ++ deployments/containerfiles/Dockerfile-cuiloa | 12 ++++++ 3 files changed, 54 insertions(+) create mode 100644 deployments/containerfiles/Dockerfile-cuiloa diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index a7caf921b8..36757dae1b 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -200,3 +200,42 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + + cuiloa: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Log in to the Docker Hub container registry (for pulls) + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Log in to the GitHub container registry (for pushes) + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/penumbra-zone/cuiloa + + - name: Build and push Docker image + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/amd64 + # TODO: work with upstream and build container in cuiloa repo + file: deployments/containerfiles/Dockerfile-cuiloa + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 09461420e8..9700d9ad8e 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -81,6 +81,9 @@ jobs: - name: bounce osiris run: kubectl rollout restart deployment osiris-preview + - name: bounce cuiloa + run: kubectl rollout restart deployment cuiloa-preview + # We only run one (1) relayer instance, and re-deploy it as part of the preview update. # The other end of the configured path is the long-running testnet. # We ignore errors on the bounce, because we may have removed the deployment out of band: diff --git a/deployments/containerfiles/Dockerfile-cuiloa b/deployments/containerfiles/Dockerfile-cuiloa new file mode 100644 index 0000000000..77f4734dac --- /dev/null +++ b/deployments/containerfiles/Dockerfile-cuiloa @@ -0,0 +1,12 @@ +FROM docker.io/library/node:20-alpine + +RUN npm install -g pnpm +USER node +RUN git clone https://github.com/ejmg/cuiloa --depth 1 /home/node/app +WORKDIR /home/node/app + +RUN pnpm install +RUN pnpm build + +EXPOSE 3000 +CMD [ "pnpm", "dev" ]