Files
OpenBB/.github/workflows/docker.yml
Luqman 5d39b5ca6c Feature/release branch gitflow (#4034)
* release branch gitflow

* installer test

* Revert intel build fix

* poetry install

* Mac build poetry fix

* Poetry cache clear

* Poetry fix

* Added cancel

* Minor fix

* Github Pages fix

* GH page fix

* Added condition to docker publish

* Fix nightly build

* Added hotfix to integration test and build gh run

* Minor fix

* Edit trigger for integration test

* minor corrections

Co-authored-by: James Maslek <jmaslek11@gmail.com>
2023-01-25 14:30:02 +01:00

44 lines
1.4 KiB
YAML
Vendored

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
- name: Publishing the Docker image
run: |
docker push "${OPENBBTERMINAL_DOCKER_POETRY_IMAGE}"
if: startsWith(github.ref, 'refs/heads/main') || startsWith(github.ref, 'refs/heads/release/')