Skip to content

Commit

Permalink
Merge pull request #581 from TrekkieCoder/main
Browse files Browse the repository at this point in the history
gh-516 - gh-actions support for multi-arch docker
  • Loading branch information
UltraInstinct14 authored Mar 10, 2024
2 parents 5173e99 + 5323517 commit ea8abe3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/basic-sanity-ubuntu-22.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- run: sudo -E env "PATH=$PATH" make
- run: sudo -E env "PATH=$PATH" make test
- run: docker pull ghcr.io/loxilb-io/loxilb:latest
- run: docker run -u root --cap-add SYS_ADMIN --restart unless-stopped --privileged -dit -v /dev/log:/dev/log --name loxilb ghcr.io/loxilb-io/loxilb:latest
- run: docker run -u root --cap-add SYS_ADMIN --restart unless-stopped --privileged -dit -v /dev/log:/dev/log --name loxilb ghcr.io/loxilb-io/loxilb:latest-amd64
- run: pwd && ls && sudo -E env "PATH=$PATH" make docker-cp-ebpf
- run: docker exec -dit loxilb mkllb_bpffs
- run: id=`docker ps -f name=loxilb | cut -d " " -f 1 | grep -iv "CONTAINER"` && docker commit $id ghcr.io/loxilb-io/loxilb:latest
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
tagName:
description: 'Tag Name'
required: true
default: 'latest'
default: 'latest-amd64'

jobs:

Expand All @@ -31,22 +31,23 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build the latest loxilb Docker image
- name: Build and run the latest loxilb Docker image
if: github.event.inputs.tagName == ''
run: docker build . --tag ghcr.io/loxilb-io/loxilb:latest
run: |
docker build . --tag ghcr.io/loxilb-io/loxilb:latest-amd64
docker run -u root --cap-add SYS_ADMIN --restart unless-stopped --privileged -dit -v /dev/log:/dev/log --name loxilb ghcr.io/loxilb-io/loxilb:latest-amd64
- name: Build the loxilb Docker image with given tag
- name: Build and run the loxilb Docker image with given tag
if: github.event.inputs.tagName != ''
run: docker build . --tag ghcr.io/loxilb-io/loxilb:${{ github.event.inputs.tagName }}
run: |
docker build . --tag ghcr.io/loxilb-io/loxilb:${{ github.event.inputs.tagName }}
docker run -u root --cap-add SYS_ADMIN --restart unless-stopped --privileged -dit -v /dev/log:/dev/log --name loxilb ghcr.io/loxilb-io/loxilb:${{ github.event.inputs.tagName }}
- name: Run the loxilb docker image to check
run: docker run -u root --cap-add SYS_ADMIN --restart unless-stopped --privileged -dit -v /dev/log:/dev/log --name loxilb ghcr.io/loxilb-io/loxilb:latest

- name: Publish the latest loxilb Docker image
if: |
github.repository == 'loxilb-io/loxilb'
&& github.event.inputs.tagName == ''
run: docker push ghcr.io/loxilb-io/loxilb:latest
run: docker push ghcr.io/loxilb-io/loxilb:latest-amd64

- name: Publish the loxilb Docker image with given tag
if: |
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/docker-multiarch.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
name: Docker-Multi-Arch

on:
push:
branches: [ "main" ]
workflow_dispatch:
inputs:
tagName:
description: 'Tag Name'
required: true
default: 'latest'

jobs:
build:
Expand Down Expand Up @@ -40,7 +37,7 @@ jobs:
context: .
platforms: linux/amd64, linux/arm64
push: false
tags: ghcr.io/loxilb-io/loxilb:${{ github.event.inputs.tagName }}
tags: ghcr.io/loxilb-io/loxilb:latest

- name: Build and push
if: |
Expand All @@ -50,4 +47,4 @@ jobs:
context: .
platforms: linux/amd64, linux/arm64
push: true
tags: ghcr.io/loxilb-io/loxilb:${{ github.event.inputs.tagName }}
tags: ghcr.io/loxilb-io/loxilb:latest
2 changes: 1 addition & 1 deletion .github/workflows/k3s-base-sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
required: true
default: 'k3s-base'
workflow_run:
workflows: ["Build-CI"]
workflows: ["Docker-Multi-Arch"]
types:
- completed
jobs:
Expand Down

0 comments on commit ea8abe3

Please sign in to comment.