updated tracking parameters #33
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: Build and Push Quantconn Docker Image | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
IMAGE_NAME: quantconn | |
IMAGE_NAMESPACE: dipy | |
TAG: latest | |
# permissions: | |
# contents: read | |
# pull-requests: write | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Build Quantconn docker image | |
run: | | |
NO_TAG="ghcr.io/${IMAGE_NAMESPACE}/${IMAGE_NAME}" | |
TAG="${NO_TAG}:${{github.sha}}" | |
TAG2="${NO_TAG}:latest" | |
TAG="$(echo "${TAG}" | tr -d '[:space:]')" | |
TAG2="$(echo "${TAG2}" | tr -d '[:space:]')" | |
echo $TAG | |
docker build --no-cache -t $TAG -t $TAG2 . | |
- name: Build a tagged image | |
if: startsWith(github.event.ref, 'refs/tags') | |
run: | | |
NO_TAG="ghcr.io/${IMAGE_NAMESPACE}/${IMAGE_NAME}" | |
TAG="${NO_TAG}:${GITHUB_REF:10}" | |
TAG2="${NO_TAG}:latest" | |
TAG="$(echo "${TAG}" | tr -d '[:space:]')" | |
TAG2="$(echo "${TAG2}" | tr -d '[:space:]')" | |
echo $TAG | |
docker build --no-cache -t $TAG -t $TAG2 . | |
- name: Login to GHCR | |
if: github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags') | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push Quantconn docker image | |
if: github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags') | |
run: | | |
NO_TAG="ghcr.io/${IMAGE_NAMESPACE}/${IMAGE_NAME}" | |
NO_TAG="$(echo "${NO_TAG}" | tr -d '[:space:]')" | |
docker push --all-tags $NO_TAG |