Merge pull request #6 from sammrai/dependabot/pip/ccxt-4.3.16 #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create and publish a Docker image | |
on: | |
push: | |
branches: | |
- "main" | |
- "test" | |
jobs: | |
docker-build: | |
runs-on: ubuntu-latest | |
env: | |
IMAGE_NAME: ${{ github.repository }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
if: github.ref == 'refs/heads/main' | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
tags: | | |
${{ github.repository }}:${{ github.sha }} | |
${{ github.repository }}:latest | |
- name: Build and push for test branch | |
if: github.ref == 'refs/heads/test' | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
tags: | | |
${{ github.repository }}:${{ github.sha }} | |
${{ github.repository }}:test | |
- name: Run tests | |
run: | | |
docker pull ${{ github.repository }}:${{ github.sha }} | |
docker run --rm ${{ github.repository }}:${{ github.sha }} --exchanges kucoin kraken --symbols BTC/USDT ETH/USDT |