Skip to content

Commit

Permalink
Merge pull request #1671 from skalenetwork/develop
Browse files Browse the repository at this point in the history
New beta (publish docker image hotfix)
  • Loading branch information
DmytroNazarenko authored Jan 18, 2024
2 parents d4c0518 + 16ba275 commit 7fc3623
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,10 @@ jobs:
with:
release_id: ${{ steps.create_release.outputs.id }}
assets_path: proxy/data/ima-schain-*-manifest.json

- name: Build and publish image
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: scripts/build_and_publish_image.sh
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:18

RUN mkdir /app

COPY VERSION /app
COPY proxy /app

WORKDIR /app

RUN yarn install
34 changes: 34 additions & 0 deletions scripts/build_and_publish_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
set -ea

if [ -z "$VERSION" ]
then
echo "No VERSION provided, exiting"
exit 1
fi

NAME=ima-contracts
REPO_NAME=skalenetwork/$NAME
IMAGE_NAME=$REPO_NAME:$VERSION
LATEST_IMAGE_NAME=$REPO_NAME:latest

if [ -z "$SKIP_BUILD" ]
then

docker build -t "$IMAGE_NAME" .

if [ "$RELEASE" = true ]
then
docker tag "$IMAGE_NAME" "$LATEST_IMAGE_NAME"
fi
fi

if [[ ! -z "$DOCKER_USERNAME" ]]
then
echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
docker push "$IMAGE_NAME"
if [ "$RELEASE" = true ]
then
docker push $LATEST_IMAGE_NAME
fi
fi

0 comments on commit 7fc3623

Please sign in to comment.