-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (56 loc) · 1.92 KB
/
build_multiarch_image_native.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
name: Build Multi-Arch Image via Native
on: [push, workflow_dispatch]
jobs:
build:
name: Build Multi-Arch image via Native
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install SSH key (ppc64le)
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.RUNNER_PPC64LE_SSH_KEY }}
name: id_rsa_ppc64le
known_hosts: unnecessary
config: |
Host runner-ppc64le
HostName ${{ secrets.RUNNER_PPC64LE_SSH_HOST }}
User root
IdentityFile ~/.ssh/id_rsa_ppc64le
StrictHostKeyChecking no
- name: Install SSH key (arm64)
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.RUNNER_ARM64_SSH_KEY }}
name: id_rsa_arm64
known_hosts: unnecessary
config: |
Host runner-arm64
HostName ${{ secrets.RUNNER_ARM64_SSH_HOST }}
User root
IdentityFile ~/.ssh/id_rsa_arm64
StrictHostKeyChecking no
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
version: v0.11.0
platforms: linux/amd64
append: |
- endpoint: ssh://runner-ppc64le
platforms: linux/ppc64le
- endpoint: ssh://runner-arm64
platforms: linux/arm64
- name: Login to container registry
uses: docker/login-action@v2
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
registry: ${{ vars.REGISTRY }}
- name: Build and Push Image
uses: docker/build-push-action@v4
with:
context: ./native/
tags: ${{ vars.REGISTRY }}/${{ vars.REPO_NAME }}/${{ vars.IMAGE_NAME }}:latest
platforms: linux/amd64,linux/arm64,linux/ppc64le
push: true