-
Notifications
You must be signed in to change notification settings - Fork 40
90 lines (82 loc) · 2.33 KB
/
docker-image.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
name: Docker Image CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build-AMD64:
runs-on: [self-hosted, linux, x64]
steps:
-
name: Get current date
id: date
run: echo "::set-output name=today::$(date +'%Y-%m-%d_%H-%M')"
-
name: Checkout
uses: actions/checkout@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_ACCOUNT }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile.x86
push: true
tags: |
hkustswarm/d2slam:${{ steps.date.outputs.today }}
hkustswarm/d2slam:pc
hkustswarm/d2slam:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
build-ARM64:
runs-on: [self-hosted, linux, arm64]
steps:
-
name: Get current date
id: date
run: echo "::set-output name=today::$(date +'%Y-%m-%d_%H-%M')"
-
name: Checkout
uses: actions/checkout@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_ACCOUNT }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build-base and push
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile.jetson_orin_base_35.3.1
push: true
tags: |
hkustswarm/d2slam:jetson_orin_base_35.3.1-${{ steps.date.outputs.today }}
hkustswarm/d2slam:jetson_orin_base_35.3.1
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
-
name: Build-app and push
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile.jetson
push: true
tags: |
hkustswarm/d2slam:jetson_orin-${{ steps.date.outputs.today }}
hkustswarm/d2slam:jetson_orin
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache