diff --git a/.github/workflows/sunhat-dev-publish.yml b/.github/workflows/sunhat-dev-publish.yml new file mode 100644 index 0000000..d3904ec --- /dev/null +++ b/.github/workflows/sunhat-dev-publish.yml @@ -0,0 +1,44 @@ +name: Publish sunaget/sunhat-dev + +on: + workflow_dispatch: + inputs: + image_tag: + description: 'tag of image(e.g. 0.1.0)' + required: true + type: string + +jobs: + build-and-push: + runs-on: ubuntu-latest + + environment: release + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: sunagent/sunhat-dev + tags: | + type=sha,prefix=,suffix=,format=short + type=raw,value=${{ github.event.inputs.image_tag }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64,linux/arm64 + file: ./docker/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..24fe406 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,27 @@ +FROM ubuntu:22.04 + +# default shell +SHELL ["/bin/bash", "-c"] + +# base deps +RUN apt-get update \ + && apt-get install -y python3 python3-pip make g++ build-essential wget curl ca-certificates git vim\ + && rm -rf /var/lib/apt/lists/* + +# nvm & nodejs +RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash +RUN source /root/.nvm/nvm.sh \ + && nvm install 22 \ + && npm install -g npm@latest + +# vyper +RUN pip3 install vyper==0.2.8 + +# pnpm +RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.bashrc" SHELL="$(which bash)" bash - + +# foundry +RUN curl -L https://foundry.paradigm.xyz | bash +RUN /root/.foundry/bin/foundryup --install nightly + +WORKDIR /workspace