-
Notifications
You must be signed in to change notification settings - Fork 23
86 lines (76 loc) · 2.68 KB
/
turing-publish.yaml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Turing/Publish
on:
workflow_call:
inputs:
api_version:
type: string
required: true
description: Semantic version of turing-api artifact to be published
router_version:
type: string
required: true
description: Semantic version of turing-router artifact to be published
container_registry:
type: string
required: false
default: ghcr.io
environment:
type: string
required: false
secrets:
ghcr_token:
required: true
jobs:
publish-router:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ inputs.container_registry }}
username: ${{ github.actor }}
password: ${{ secrets.ghcr_token }}
- name: Download Docker image tar
uses: actions/download-artifact@v4
with:
name: turing-router.${{ inputs.router_version }}.tar
- name: Publish Docker Image
env:
DOCKER_REPOSITORY: ${{ inputs.container_registry }}/${{ github.repository }}
run: |
docker image load --input turing-router.${{ inputs.router_version }}.tar
docker tag \
turing-router:${{ inputs.router_version }} \
${{ env.DOCKER_REPOSITORY }}/turing-router:${{ inputs.router_version }}
docker push ${{ env.DOCKER_REPOSITORY }}/turing-router:${{ inputs.router_version }}
publish-app:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ inputs.container_registry }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Download Docker image tar
uses: actions/download-artifact@v4
with:
name: turing-api.${{ inputs.api_version }}.tar
- name: Download Turing UI Dist
uses: actions/download-artifact@v4
with:
name: turing-ui-dist
path: ui/build
- name: Build and Publish Turing Docker image
env:
DOCKER_REGISTRY: ${{ inputs.container_registry }}/${{ github.repository_owner }}
TURING_API_IMAGE: turing-api:${{ inputs.api_version }}
OVERWRITE_VERSION: ${{ inputs.api_version }}
run: |
docker image load --input turing-api.${{ inputs.api_version }}.tar
make build-image
docker push ${{ env.DOCKER_REGISTRY }}/turing:${{ env.OVERWRITE_VERSION }}