diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml new file mode 100644 index 0000000..df46f88 --- /dev/null +++ b/.github/workflows/ghcr.yml @@ -0,0 +1,42 @@ +name: GitHub Container Registry +on: + release: + types: [published] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + ghcr: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=semver,pattern={{raw}} + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4472b9c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM oven/bun +COPY . . +RUN bun install +ENTRYPOINT [ "bun", "./index.ts" ] \ No newline at end of file diff --git a/README.md b/README.md index d1a65c2..85b758e 100644 --- a/README.md +++ b/README.md @@ -84,19 +84,22 @@ Options: -h, --help display help for command ``` -## Docker environment (SOON) +## Docker environment + +Pull from GitHub Container registry - +docker run -it --rm --env-file .env ghcr.io/pinax-network/substreams-erc20-api +```