-
Notifications
You must be signed in to change notification settings - Fork 212
123 lines (108 loc) · 3.62 KB
/
docker.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
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
name: Build and Push to DockerHUB
on:
push:
tags:
- 'v*' # Only run on tags that start with 'v'
permissions:
# allow issuing OIDC tokens for this workflow run
id-token: write
# allow at least reading the repo contents, add other permissions if necessary
contents: read
jobs:
docker-monolith-image:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Depot CLI
uses: depot/setup-action@v1
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Is release version
id: tag_check
run: |
TAG=${GITHUB_REF#refs/tags/}
if [[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "is_release_version=true" >> $GITHUB_ENV
else
echo "is_release_version=false" >> $GITHUB_ENV
fi
- name: Build and push tag
uses: depot/build-push-action@v1
if: env.is_release_version == 'false'
with:
project: 6zxrst4dlr
platforms: linux/amd64,linux/arm64
push: true
context: .
file: docker/Dockerfile
tags: briefercloud/briefer:${{ github.ref_name }}
- name: Build and push tag and release
uses: depot/build-push-action@v1
if: env.is_release_version == 'true'
with:
project: 6zxrst4dlr
platforms: linux/amd64,linux/arm64
push: true
context: .
file: docker/Dockerfile
tags: briefercloud/briefer:${{ github.ref_name }},briefercloud/briefer:latest
docker-multiple-images:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: 'web'
dockerfile: 'apps/web/Dockerfile'
context: '.'
- name: 'api'
dockerfile: 'apps/api/Dockerfile'
context: '.'
- name: 'ai'
dockerfile: 'ai/Dockerfile'
context: 'ai'
- name: 'jupyter'
context: 'apps/api'
dockerfile: 'apps/api/jupyter.Dockerfile'
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Depot CLI
uses: depot/setup-action@v1
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Is release version
id: tag_check
run: |
TAG=${GITHUB_REF#refs/tags/}
if [[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "is_release_version=true" >> $GITHUB_ENV
else
echo "is_release_version=false" >> $GITHUB_ENV
fi
- name: Build and push tag
uses: depot/build-push-action@v1
if: env.is_release_version == 'false'
with:
project: 6zxrst4dlr
platforms: linux/amd64,linux/arm64
push: true
context: ${{ matrix.context }}
file: ${{ matrix.dockerfile }}
tags: briefercloud/briefer-${{ matrix.name }}:${{ github.ref_name }}
- name: Build and push tag and release
uses: depot/build-push-action@v1
if: env.is_release_version == 'true'
with:
project: 6zxrst4dlr
platforms: linux/amd64,linux/arm64
push: true
context: ${{ matrix.context }}
file: ${{ matrix.dockerfile }}
tags: briefercloud/briefer-${{ matrix.name }}:${{ github.ref_name }},briefercloud/briefer-${{ matrix.name }}:latest