Skip to content

Commit 49acf1e

Browse files
authored
add docker build workflow (#39)
1 parent be2647f commit 49acf1e

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/docker-build.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: ci
2+
3+
on:
4+
release:
5+
types: [created, published]
6+
7+
jobs:
8+
docker:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
include:
14+
- context: ./ui
15+
image: ${{ secrets.DOCKER_HUB_USERNAME }}/codepod-ui
16+
- context: ./api
17+
image: ${{ secrets.DOCKER_HUB_USERNAME }}/codepod-api
18+
- context: ./proxy
19+
image: ${{ secrets.DOCKER_HUB_USERNAME }}/codepod-proxy
20+
- context: ./runtime/kernel
21+
image: ${{ secrets.DOCKER_HUB_USERNAME }}/codepod-kernel-python
22+
- context: ./runtime
23+
image: ${{ secrets.DOCKER_HUB_USERNAME }}/codepod-runtime
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v3
27+
-
28+
name: Docker meta
29+
id: meta
30+
uses: docker/metadata-action@v4
31+
with:
32+
# list of Docker images to use as base name for tags
33+
images: |
34+
${{ matrix.image }}
35+
# generate Docker tags based on the following events/attributes
36+
tags: |
37+
type=schedule
38+
type=ref,event=branch
39+
type=ref,event=pr
40+
type=semver,pattern={{version}}
41+
type=semver,pattern={{major}}.{{minor}}
42+
type=semver,pattern={{major}}
43+
type=sha
44+
-
45+
name: Set up QEMU
46+
uses: docker/setup-qemu-action@v2
47+
-
48+
name: Set up Docker Buildx
49+
uses: docker/setup-buildx-action@v2
50+
-
51+
name: Login to Docker Hub
52+
uses: docker/login-action@v2
53+
with:
54+
username: ${{ secrets.DOCKERHUB_USERNAME }}
55+
password: ${{ secrets.DOCKERHUB_TOKEN }}
56+
57+
- name: Build and push
58+
uses: docker/build-push-action@v3
59+
with:
60+
context: ${{ matrix.context }}
61+
push: true
62+
tags: ${{ steps.meta.outputs.tags }}
63+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)