Skip to content

Commit

Permalink
add build and push actions
Browse files Browse the repository at this point in the history
  • Loading branch information
amintalebi committed Aug 26, 2024
1 parent 7689fea commit d1044a4
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Market Maker Keeper - Build and Push

on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
branch:
description: 'Branch to build and deploy'
required: false

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: 'recursive'

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to Docker Registry
uses: docker/login-action@v1
with:
registry: registry.hamdocker.ir/bitex
username: ${{ secrets.HAMRAVESH_REGISTRY_USER }}
password: ${{ secrets.HAMRAVESH_REGISTRY_PASS }}

- name: Get the branch name
id: get-branch-name
run: |
if [[ $GITHUB_HEAD_REF ]]; then
BRANCH_NAME=${GITHUB_HEAD_REF}
else
BRANCH_NAME=${GITHUB_REF#refs/heads/}
fi
BRANCH_NAME=$(echo ${BRANCH_NAME} | sed 's/\//-/g' | cut -c 1-30)
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV
- name: Set Docker image tag
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
TAG=${GITHUB_REF#refs/tags/}
else
TAG=$(echo ${GITHUB_SHA::8})
fi
echo "TAG=$TAG" >> $GITHUB_ENV
- name: Build and push market-make-keeper
uses: docker/build-push-action@v2
with:
file: Dockerfile
context: .
push: true
tags: registry.hamdocker.ir/bitex/market-maker-keeper:${{ env.TAG }}

0 comments on commit d1044a4

Please sign in to comment.