-
Notifications
You must be signed in to change notification settings - Fork 22
88 lines (83 loc) · 2.2 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
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
name: docker
on:
push:
branches:
- 'master'
paths:
- 'docker/buildx/**.Dockerfile'
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
docker:
runs-on:
- self-hosted
- ${{ matrix.arch }}
strategy:
fail-fast: false
matrix:
os:
- centos-7
- centos-8
#- ubuntu-1604
#- ubuntu-1804
- ubuntu-2004
- ubuntu-2204
arch:
- amd64
- arm64
steps:
- uses: webiny/[email protected]
with:
run: sh -c "find . -mindepth 1 -delete"
- name: Setup environment variables
id: vars
run: |
echo "TAG=$(echo ${{ matrix.os }} | tr -d '-')" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ${{ secrets.HARBOR_REGISTRY }}
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_PASSWORD }}
- uses: docker/build-push-action@v4
with:
context: .
file: ./docker/buildx/${{ matrix.os }}.Dockerfile
platforms: linux/${{ matrix.arch }}
tags: |
${{ secrets.HARBOR_REGISTRY }}/vesoft/third-party-build:${{ steps.vars.outputs.TAG }}-${{ matrix.arch }}
cache-to: type=local,dest=/tmp/buildx-cache,mode=max
push: true
manifest:
needs: docker
runs-on:
- self-hosted
strategy:
fail-fast: false
matrix:
os:
- centos7
- centos8
#- ubuntu1604
#- ubuntu1804
- ubuntu2004
- ubuntu2204
steps:
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ${{ secrets.HARBOR_REGISTRY }}
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_PASSWORD }}
- name: Create and push manifest
env:
IMAGE: ${{ secrets.HARBOR_REGISTRY }}/vesoft/third-party-build:${{ matrix.os }}
run: |
docker manifest create $IMAGE --amend $IMAGE-amd64 --amend $IMAGE-arm64
docker manifest push $IMAGE