Skip to content

Commit

Permalink
Merge pull request #176 from hummingbot/fix/gateway-workflow
Browse files Browse the repository at this point in the history
add docker workflow
  • Loading branch information
fengtality authored Aug 20, 2023
2 parents 3afcafc + 6de1997 commit 5b489d3
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/docker_build_latest
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and Push Docker image

on:
pull_request:
types: [closed]
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- name: Checkout code
uses: actions/[email protected]

- name: Set up QEMU
uses: docker/[email protected]

- name: Set up Docker Buildx
uses: docker/[email protected]
with:
version: latest

- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/[email protected]
with:
context: .
push: true
tags: hummingbot/gateway:latest
platforms: linux/amd64,linux/arm64
build-args: |
BRANCH=${{ github.ref }}
COMMIT=${{ github.sha }}
BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
cache-from: type=registry,ref=hummingbot/gateway:latest
cache-to: type=inline

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
37 changes: 37 additions & 0 deletions .github/workflows/docker_build_tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build and push Docker images on release

on:
release:
types: [published, edited]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/[email protected]

- name: Set up Docker Buildx
uses: docker/[email protected]

- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract tag name
id: get_tag
run: echo ::set-output name=VERSION::version-${GITHUB_REF#refs/tags/v}

- name: Build and push
uses: docker/[email protected]
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: hummingbot/gateway:${{ steps.get_tag.outputs.VERSION }}

0 comments on commit 5b489d3

Please sign in to comment.