-
-
Notifications
You must be signed in to change notification settings - Fork 29
63 lines (52 loc) · 2.28 KB
/
publish-docker.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: Publish Docker Images
on:
push:
branches:
- main
tags:
- "v*"
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Determine Version
id: version
run: |
if [ "${{ github.ref_type }}" == "tag" ]; then
echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
else
echo "VERSION=latest" >> $GITHUB_ENV
fi
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_API_KEY }}
- name: Build and Push Web Image
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/chipper:web-${{ env.VERSION }} services/web
docker push ${{ secrets.DOCKER_USERNAME }}/chipper:web-${{ env.VERSION }}
- name: Build and Push API Image
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/chipper:api-${{ env.VERSION }} services/api
docker push ${{ secrets.DOCKER_USERNAME }}/chipper:api-${{ env.VERSION }}
- name: Build and Push CLI Tool Image
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/chipper:cli-${{ env.VERSION }} tools/cli
docker push ${{ secrets.DOCKER_USERNAME }}/chipper:cli-${{ env.VERSION }}
- name: Build and Push Embed Tool Image
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/chipper:embed-${{ env.VERSION }} tools/embed
docker push ${{ secrets.DOCKER_USERNAME }}/chipper:embed-${{ env.VERSION }}
- name: Build and Push Scrape Tool Image
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/chipper:scrape-${{ env.VERSION }} tools/scrape
docker push ${{ secrets.DOCKER_USERNAME }}/chipper:scrape-${{ env.VERSION }}
# To save resources, we should not build and push the transcription every time.
# TODO: Figure out a strategy how to manage the transcribe tool image.
# - name: Build and Push Transcribe Tool Image
# run: |
# docker build -t ${{ secrets.DOCKER_USERNAME }}/chipper:transcribe-${{ env.VERSION }} tools/transcribe
# docker push ${{ secrets.DOCKER_USERNAME }}/chipper:transcribe-${{ env.VERSION }}