-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (96 loc) · 3.74 KB
/
docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Docker Environment Pipeline
# 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 GHCR
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.PACKAGES_TOKEN }}
- name: Get branch name
id: branch-name
uses: tj-actions/[email protected]
- name: Build and Push MetaTrader 5 Terminal image (latest) to Github Packages
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/"
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 DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push MetaTrader 5 Terminal image (latest) to DockerHub
if: ${{ steps.branch-name.outputs.current_branch == 'main' }}
id: mt5_build_docker_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_docker_latest.outputs.digest }}
# - name: Build Trade Flow Environment image (latest)
# if: ${{ steps.branch-name.outputs.current_branch == 'main' }}
# id: trade_flow_env_build_latest
# uses: docker/build-push-action@v3
# with:
# context: .
# push: true
# tags: ghcr.io/${{ github.repository_owner }}/trade_flow:latest
# cache-from: type=gha
# cache-to: type=gha
# - name: Digest trade_flow image
# run: echo ${{ steps.trade_flow_env_build_latest.outputs.digest }}