Merge pull request #1095 from tradingstrategy-ai/temp-fix-inf-value #49
Workflow file for this run
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: Docker image | |
on: | |
push: | |
tags: [ v* ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
# needs: automated-test-suite | |
# Only build on tag push or branch push with rc-* prefix | |
if: (github.event_name == 'push' && contains(github.ref, 'refs/tags/v')) || startsWith(github.head_ref, 'rc-') | |
env: | |
REGISTRY: ghcr.io | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Read metadata | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.REGISTRY }}/${{ github.repository }} | |
- name: Log in to Github Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# https://stackoverflow.com/a/58178121/315168 | |
- name: Scrape build info | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
# platforms: ${{ matrix.platform }} | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
# experimental: https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#cache-backend-api | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
# https://stackoverflow.com/questions/67051284/how-to-set-a-dockerfile-arg-in-github-actions | |
# https://stackoverflow.com/a/63619526/315168 | |
build-args: | | |
GIT_VERSION_TAG=${{ env.RELEASE_VERSION }} | |
GIT_COMMIT_MESSAGE=${{ github.event.head_commit.message }} | |
GIT_VERSION_HASH=${{ github.sha }} |