-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (37 loc) · 1.44 KB
/
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
name: Build Docker Image
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- tag: latest
features: c,cpp,rs
- tag: c
features: c,cpp
- tag: rs
features: rs
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Copy .env file
run: cp .env.example .env
- name: Build and Push
run: docker buildx bake --set '*.platform=linux/arm64/v8,linux/amd64' --push
if: matrix.tag == 'latest'
- name: Build and Push (${{ matrix.tag }})
run: docker buildx build --build-arg COMPILET_FEATURES=${{ matrix.features }} --platform linux/arm64/v8,linux/amd64 --push --target runtime-${{ matrix.tag }} --tag ${{ secrets.DOCKERHUB_USERNAME }}/compilet:${{ matrix.tag }} .
if: matrix.tag != 'latest'