Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: CI
on:
push:
pull_request:
workflow_dispatch:

jobs:
test:
Expand Down Expand Up @@ -31,3 +32,27 @@ jobs:
run: |
docker compose run --rm -T pricefeed \
node -e "const { loadConfig } = require('./src/config-loader'); const c = loadConfig(); if (!Array.isArray(c.rpc_nodes) || c.rpc_nodes.length < 3) { console.error('rpc_nodes missing or too few'); process.exit(1); } console.log('docker compose smoke test OK; account =', c.feed_steem_account);"

docker_push:
name: Build and push image to Docker Hub
needs: [test, docker]
# Publish :latest only from master (or a manual run). Pull requests are
# skipped because they cannot access the environment secrets.
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
environment: dockerhub
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push justyy/pricefeed:latest
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: justyy/pricefeed:latest
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![CI](https://github.com/DoctorLai/pricefeed/actions/workflows/ci.yml/badge.svg)](https://github.com/DoctorLai/pricefeed/actions/workflows/ci.yml)
[![Node.js](https://img.shields.io/badge/node-%3E%3D18-43853d?logo=node.js&logoColor=white)](https://nodejs.org/)
[![Docker Hub](https://img.shields.io/docker/pulls/justyy/pricefeed?logo=docker&logoColor=white)](https://hub.docker.com/r/justyy/pricefeed)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

![image](https://user-images.githubusercontent.com/1764434/173547905-6366f5eb-22dc-4327-bbda-6a4cc4cd3b96.png)
Expand Down Expand Up @@ -116,6 +117,26 @@ $ docker run -itd \
pricefeed
```

#### Use the prebuilt image from Docker Hub

A prebuilt image is published to Docker Hub as
[`justyy/pricefeed`](https://hub.docker.com/r/justyy/pricefeed), so you can skip
the build step and pull it directly:

```
$ docker pull justyy/pricefeed:latest

# Edit config.yaml first, then run the container
$ docker run -itd \
--name pricefeed \
-v $(pwd)/config.yaml:/app/config.yaml:ro \
justyy/pricefeed:latest
```

The `latest` tag is rebuilt and pushed automatically by CI on every push to the
`master` branch (see the `docker_push` job in
[.github/workflows/ci.yml](.github/workflows/ci.yml)).

### Run with Docker Compose

```
Expand Down
Loading