Skip to content

Commit

Permalink
Merge pull request #944 from hemilabs/token-price-docker-images
Browse files Browse the repository at this point in the history
Build token prices service Docker images
  • Loading branch information
gabmontes authored Mar 3, 2025
2 parents a01d298 + 6652d5c commit e2d2a7c
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/actions/docker-build-push/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Docker Build and Push

description: Build and push Docker images

inputs:
context:
description: 'The build context'
required: false
default: '.'
dockerHubPassword:
description: 'Docker Hub token'
required: true
dockerHubUsername:
description: 'Docker Hub username'
required: true
images:
description: 'The Docker image name'
required: true

runs:
using: composite
steps:
- uses: docker/setup-buildx-action@v3
- id: meta
uses: docker/metadata-action@v5
with:
images: ${{ inputs.images }}
- uses: docker/login-action@v3
with:
password: ${{ inputs.dockerHubPassword }}
username: ${{ inputs.dockerHubUsername }}
- uses: docker/build-push-action@v6
with:
context: ${{ inputs.context }}
file: ./Dockerfile
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
27 changes: 27 additions & 0 deletions .github/workflows/build-push-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish Docker image

on:
push:
branches:
- main
paths:
- 'token-prices/**'
workflow_dispatch:

jobs:
token-prices:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/docker-build-push
with:
context: token-prices/cron
dockerHubPassword: ${{ secrets.DOCKERHUB_TOKEN }}
dockerHubUsername: ${{ secrets.DOCKERHUB_USERNAME }}
images: hemilabs/token-prices-cron
- uses: ./.github/actions/docker-build-push
with:
context: token-prices/api
dockerHubPassword: ${{ secrets.DOCKERHUB_TOKEN }}
dockerHubUsername: ${{ secrets.DOCKERHUB_USERNAME }}
images: hemilabs/token-prices-api

0 comments on commit e2d2a7c

Please sign in to comment.