-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (51 loc) · 1.77 KB
/
docker_quantconn.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
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