Skip to content

Merge pull request #673 from TrekkieCoder/main #688

Merge pull request #673 from TrekkieCoder/main

Merge pull request #673 from TrekkieCoder/main #688

Workflow file for this run

name: Build-CI
on:
push:
branches: [ "main" ]
workflow_dispatch:
inputs:
tagName:
description: 'Tag Name'
required: true
default: 'latest-amd64'
jobs:
build:
name: build-ci
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and run the latest loxilb Docker image
if: github.event.inputs.tagName == ''
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 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 }}
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: 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-amd64
- name: Publish the loxilb Docker image with given tag
if: |
github.repository == 'loxilb-io/loxilb'
&& github.event.inputs.tagName != ''
run: docker push ghcr.io/loxilb-io/loxilb:${{ github.event.inputs.tagName }}
# This is currently not supported yet for docker packages
- name: Cleanup old Docker packages
uses: actions/delete-package-versions@v3
with:
package-name: 'loxilb'
num-old-versions-to-delete: 3