-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (87 loc) · 3.11 KB
/
schedule-build.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
name: schedule-build
on:
workflow_dispatch:
schedule:
- cron: '0 22 * * *'
env:
DOCKER-IMAGE-BASE-AMD: ubeike/raspicat-noetic:amd64-base
DOCKER-IMAGE-BASE-ARM: ubeike/raspicat-noetic:arm64v8-base
DOCKER-IMAGE-ARM: ubeike/raspicat-noetic:arm64v8
DOCKER-IMAGE-AMD-NVIDIA: ubeike/raspicat-noetic:amd64-nvidia
DOCKER-CONTEXT: ./
DOCKER-FILE-BASE-AMD: ./.github/Dockerfile.raspicat-amd64-base
DOCKER-FILE-BASE-ARM: ./.github/Dockerfile.raspicat-arm64v8-base
DOCKER-FILE-ARM: ./.github/Dockerfile.raspicat-schedule-build
DOCKER-FILE-AMD-NVIDIA: ./.github/Dockerfile.raspicat-amd64-nvidia
jobs:
Create-Base-Image:
runs-on: ubuntu-20.04
timeout-minutes: 50
steps:
- name: Run actions/checkout@v2
uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Create id_rsa
run: |
mkdir -p ./.github/ssh/
echo "${{ secrets.SSH_PRIVATE_KEY}}" > ./.github/ssh/id_rsa
- name: Build and push docker image amd64 base
uses: docker/build-push-action@v2
with:
context: ${{ env.DOCKER-CONTEXT }}
file: ${{ env.DOCKER-FILE-BASE-AMD }}
builder: ${{ steps.buildx.outputs.name }}
tags: ${{ env.DOCKER-IMAGE-BASE-AMD }}
push: true
- name: Qemu install
run: |
sudo apt install qemu-user-static
- name: Build and push docker image arm64v8 base
uses: docker/build-push-action@v2
with:
context: ${{ env.DOCKER-CONTEXT }}
file: ${{ env.DOCKER-FILE-BASE-ARM }}
builder: ${{ steps.buildx.outputs.name }}
tags: ${{ env.DOCKER-IMAGE-BASE-ARM }}
push: true
Build:
runs-on: ubuntu-20.04
timeout-minutes: 50
needs: Create-Base-Image
steps:
- name: Run actions/checkout@v2
uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Qemu install
run: |
sudo apt install qemu-user-static
- name: Build and push docker image arm64v8
uses: docker/build-push-action@v2
with:
context: ${{ env.DOCKER-CONTEXT }}
file: ${{ env.DOCKER-FILE-ARM }}
builder: ${{ steps.buildx.outputs.name }}
tags: ${{ env.DOCKER-IMAGE-ARM }}
push: true
- name: Build and push docker image amd64 nvidia
uses: docker/build-push-action@v2
with:
context: ${{ env.DOCKER-CONTEXT }}
file: ${{ env.DOCKER-FILE-AMD-NVIDIA }}
builder: ${{ steps.buildx.outputs.name }}
tags: ${{ env.DOCKER-IMAGE-AMD-NVIDIA }}
push: true