Adds MetaTrader 5 terminal service #8
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: Deploy MetaTrader 5 Terminal (with RPYC API) | |
# on: | |
# workflow_dispatch: | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build-images: | |
name: build-images | |
runs-on: ubuntu-latest | |
env: | |
BUILD_MODE: release | |
steps: | |
- name: Free disk space (Ubuntu) | |
uses: jlumbroso/free-disk-space@main | |
with: | |
tool-cache: true | |
android: false | |
dotnet: false | |
haskell: false | |
large-packages: true | |
docker-images: true | |
swap-storage: true | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: "true" | |
- name: Checkout lfs | |
run: | | |
git lfs install --local | |
AUTH=$(git config --local http.${{ github.server_url }}/.extraheader) | |
git config --local --unset http.${{ github.server_url }}/.extraheader | |
git config --local http.${{ github.server_url }}/${{ github.repository }}.git/info/lfs/objects/batch.extraheader "$AUTH" | |
git lfs pull | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3.1.0 | |
with: | |
username: ${{ secrets.DOCKERHUB_USER }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Get branch name | |
id: branch-name | |
uses: tj-actions/branch-names@v8.0.1 | |
- name: Build and Push MetaTrader 5 Terminal image (latest) to DockerHub | |
if: ${{ steps.branch-name.outputs.current_branch == 'main' }} | |
id: mt5_build_latest | |
uses: docker/build-push-action@v3 | |
with: | |
file: "infrastructure/MetaTrader5/Dockerfile" | |
context: "infrastructure/MetaTrader5/" | |
platforms: linux/amd64 | |
push: true | |
tags: ${{ github.repository_owner }}/metatrader5-terminal:latest,${{ github.repository_owner }}/metatrader5-terminal:${{ github.sha }},${{ github.repository_owner }}/metatrader5-terminal:${{ github.run_id }} | |
cache-from: type=gha | |
cache-to: type=gha | |
- name: Digest metatrader5-terminal image | |
run: echo ${{ steps.mt5_build_latest.outputs.digest }} | |
- name: Login to GHCR | |
uses: docker/login-action@v3.1.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.PACKAGES_TOKEN }} | |
- name: Build and Push MetaTrader 5 Terminal image (latest) to Github Packages | |
if: ${{ steps.branch-name.outputs.current_branch == 'main' }} | |
id: mt5_build_ghcr_latest | |
uses: docker/build-push-action@v3 | |
with: | |
file: "infrastructure/MetaTrader5/Dockerfile" | |
context: "infrastructure/MetaTrader5/" | |
push: true | |
tags: ${{ github.repository_owner }}/metatrader5-terminal:latest,${{ github.repository_owner }}/metatrader5-terminal:${{ github.sha }},${{ github.repository_owner }}/metatrader5-terminal:${{ github.run_id }} | |
cache-from: type=gha | |
cache-to: type=gha | |
- name: Digest metatrader5-terminal image | |
run: echo ${{ steps.mt5_build_ghcr_latest.outputs.digest }} |