forked from OpenBB-finance/OpenBB
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (39 loc) · 1.64 KB
/
docker-build.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
name: Build and Publish Docker
on: workflow_dispatch
jobs:
publish-image:
runs-on: ubuntu-latest
env:
OPENBBTERMINAL_DOCKER_GITHUB_REPOSITORY: ${{ github.repository }}
OPENBB_LOGGING_APP_NAME: "gst_docker"
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup commit hash
run: |
echo "OPENBB_LOGGING_COMMIT_HASH=sha:$(git rev-parse --short=8 "$GITHUB_SHA")" >> $GITHUB_ENV
- name: Build env file
run: |
echo "OPENBB_LOGGING_APP_NAME='${OPENBB_LOGGING_APP_NAME}'" > openbb_terminal/.env
echo "OPENBB_LOGGING_COMMIT_HASH='${OPENBB_LOGGING_COMMIT_HASH}'" >> openbb_terminal/.env
cat openbb_terminal/.env
- name: Building the Docker image
run: |
source build/docker/compose.env
source build/docker/build.sh
echo "OPENBBTERMINAL_DOCKER_POETRY_IMAGE=$OPENBBTERMINAL_DOCKER_POETRY_IMAGE" >> $GITHUB_ENV
echo "OPENBBTERMINAL_DOCKER_POETRY_IMAGE_LATEST=$OPENBBTERMINAL_DOCKER_POETRY_IMAGE_LATEST" >> $GITHUB_ENV
- name: Publishing the Docker image (release version)
run: |
docker push "${OPENBBTERMINAL_DOCKER_POETRY_IMAGE}"
if: startsWith(github.ref, 'refs/heads/main')
- name: Publishing the latest Docker image
run: |
docker push "${OPENBBTERMINAL_DOCKER_POETRY_IMAGE_LATEST}"
if: startsWith(github.ref, 'refs/heads/main')