diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml new file mode 100644 index 0000000..810e767 --- /dev/null +++ b/.github/workflows/docker.yaml @@ -0,0 +1,24 @@ +name: build docker images + +on: + release: + types: [created] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v3 + with: + go-version: "1.22.2" + check-latest: true + - uses: actions/checkout@v2 + - name: Prepare Release Variables + id: vars + uses: ignite/cli/actions/release/vars@main + - name: build + run: | + echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u "${{ secrets.GHCR_USER }}" --password-stdin + docker build . --tag ghcr.io/${{ github.repository }}:${{ steps.vars.outputs.tag_name }} -f Dockerfile + docker push ghcr.io/${{ github.repository }}:${{ steps.vars.outputs.tag_name }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..374af7c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +# node build +from golang:1.22.2-bookworm as gobuilder +WORKDIR / +COPY . . +RUN go build -o bls-avs-tools cli/*.go + +# final image +from debian:bookworm-slim +WORKDIR / +COPY --from=gobuilder bls-avs-tools bls-avs-tools + +ENTRYPOINT ["/bls-avs-tools"] \ No newline at end of file