This repository has been archived by the owner on Nov 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (45 loc) · 1.66 KB
/
docker-publish.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
name: Docker
on:
push:
env:
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: IBM/kind-node
VERSION: v1.26.2
KIND_VERSION: v0.17.0
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: make sure repository is lowercase
run: echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Install kind
run: |
curl -Lo ./kind https://kind.sigs.k8s.io/dl/${{ env.KIND_VERSION }}/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind
- name: Build kind image
run: |
mkdir -p tmp/kubernetes
git clone --single-branch --branch v1.26.2 https://github.com/kubernetes/kubernetes tmp/kubernetes
kind build node-image $PWD/tmp/kubernetes --arch ppc64le --image ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
- name: Publish image
if: github.event_name != 'pull_request'
run: |
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
docker image tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
docker image push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest