-
Notifications
You must be signed in to change notification settings - Fork 15
165 lines (147 loc) · 5.94 KB
/
merge-main.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: Merge PR to main
permissions:
contents: read
on:
pull_request:
types:
- closed
branches:
- main
jobs:
release:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
concurrency: release
permissions:
contents: write
# Map a step output to a job output
outputs:
released: ${{ steps.release.outputs.released }}
tag: ${{ steps.release.outputs.tag }}
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Setup Python version
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: '3.11'
- name: Python Semantic Release
id: release
uses: python-semantic-release/python-semantic-release@c82bd673c30da94a02e039963c8c4c8a51758096 # v9.1.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
docker:
needs: release
if: needs.release.outputs.released == 'true'
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # v3.2.0
- name: Login to Docker Hub
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v.3.1.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish vidvec amd64 worker to dockerhub
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: "{{defaultContext}}:src/"
file: worker/vidvec/Dockerfile.video_worker
platforms: linux/amd64
build-args: |
"UID=1000"
"GID=1000"
push: true
tags: tattletech/feluda-operator-vidvec:worker-amd64-${{ needs.release.outputs.tag }}
- name: Publish vidvec arm64 worker to dockerhub
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: "{{defaultContext}}:src/"
file: worker/vidvec/Dockerfile.video_worker_graviton
platforms: linux/arm64
build-args: |
"UID=1000"
"GID=1000"
push: true
tags: tattletech/feluda-operator-vidvec:worker-arm64-${{ needs.release.outputs.tag }}
- name: Publish audiovec amd64 worker to dockerhub
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: "{{defaultContext}}:src/"
file: worker/audiovec/Dockerfile.audio_worker
platforms: linux/amd64
build-args: |
"UID=1000"
"GID=1000"
push: true
tags: tattletech/feluda-operator-audiovec:worker-amd64-${{ needs.release.outputs.tag }}
- name: Publish audiovec arm64 worker to dockerhub
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: "{{defaultContext}}:src/"
file: worker/audiovec/Dockerfile.audio_worker_graviton
platforms: linux/arm64
build-args: |
"UID=1000"
"GID=1000"
push: true
tags: tattletech/feluda-operator-audiovec:worker-arm64-${{ needs.release.outputs.tag }}
- name: Publish media hash amd64 worker to dockerhub
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: "{{defaultContext}}:src/"
file: worker/hash/Dockerfile.hash_worker
platforms: linux/amd64
build-args: |
"UID=1000"
"GID=1000"
push: true
tags: tattletech/feluda-operator-hash:worker-amd64-${{ needs.release.outputs.tag }}
- name: Publish media hash arm64 worker to dockerhub
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: "{{defaultContext}}:src/"
file: worker/hash/Dockerfile.hash_worker_graviton
platforms: linux/arm64
build-args: |
"UID=1000"
"GID=1000"
push: true
tags: tattletech/feluda-operator-hash:worker-arm64-${{ needs.release.outputs.tag }}
- name: Publish media worker amd64 worker to dockerhub
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: "{{defaultContext}}:src/"
file: worker/media/Dockerfile.media_worker
platforms: linux/amd64
build-args: |
"UID=1000"
"GID=1000"
push: true
tags: tattletech/feluda-operator-media:worker-amd64-${{ needs.release.outputs.tag }}
- name: Publish media worker arm64 worker to dockerhub
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: "{{defaultContext}}:src/"
file: worker/media/Dockerfile.media_worker_graviton
platforms: linux/arm64
build-args: |
"UID=1000"
"GID=1000"
push: true
tags: tattletech/feluda-operator-media:worker-arm64-${{ needs.release.outputs.tag }}
# - name: deploy to cluster
# uses: steebchen/[email protected]
# with: # defaults to latest kubectl binary version
# config: ${{ secrets.PROD_KUBE_CONFIG_DATA }}
# command: set image --record deployment/feluda-server feluda-server=tattletech/feluda-server:${{ steps.vars.outputs.sha_short }}
# - name: verify deployment
# uses: steebchen/[email protected]
# with:
# config: ${{ secrets.PROD_KUBE_CONFIG_DATA }}
# version: v1.21.0 # specify kubectl binary version explicitly
# command: rollout status deployment/feluda-server