Skip to content

Build Docker Container #366

Build Docker Container

Build Docker Container #366

Workflow file for this run

name: Build Docker Container
on:
push:
branches:
- main
schedule:
# Build every 6 hours
- cron: "0 */6 * * *"
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set BIRD version
run: echo "BIRD_VERSION=$(curl -s 'https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/b/' | awk -F'"' '/>bird-/ {print $6; exit}' | sed -e 's/bird-//' -e 's/\.el.*.rpm//')" >> $GITHUB_ENV
- name: Extract BIRD semver
run: |
echo '${{ env.BIRD_VERSION }}' | \
sed -E 's/^([0-9]+)\.([0-9]+).*/BIRD_MAJOR_VERSION=\1\nBIRD_MINOR_VERSION=\2/' \
>> $GITHUB_ENV
- name: Print target BIRD version
run: |
echo 'Full version: ${{ env.BIRD_VERSION }}'
echo 'Major: ${{ env.BIRD_MAJOR_VERSION }}'
echo 'Minor: ${{ env.BIRD_MINOR_VERSION }}'
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
file: Containerfile
build-args: |
BIRD_VERSION=${{ env.BIRD_VERSION }}
tags: |
ghcr.io/sonix-network/bird:${{ env.BIRD_MAJOR_VERSION }}
ghcr.io/sonix-network/bird:${{ env.BIRD_MAJOR_VERSION }}.${{ env.BIRD_MINOR_VERSION }}
ghcr.io/sonix-network/bird:v${{ env.BIRD_VERSION }}
ghcr.io/sonix-network/bird:latest
docker-dev:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set BIRD version
run: echo "BIRD_VERSION=$(curl -s 'https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/b/' | awk -F'"' '/>bird-/ {print $6; exit}' | sed -e 's/bird-//' -e 's/\.el.*.rpm//')" >> $GITHUB_ENV
- name: Extract BIRD semver
run: |
echo '${{ env.BIRD_VERSION }}' | \
sed -E 's/^([0-9]+)\.([0-9]+).*/BIRD_MAJOR_VERSION=\1\nBIRD_MINOR_VERSION=\2/' \
>> $GITHUB_ENV
- name: Extract BIRD source version
run: |
echo '${{ env.BIRD_VERSION }}' | \
sed -E 's/^([0-9\.]+).*/BIRD_SRC_VERSION=\1/' \
>> $GITHUB_ENV
- name: Print target BIRD version
run: |
echo 'Full version: ${{ env.BIRD_VERSION }}'
echo 'Source version: ${{ env.BIRD_SRC_VERSION }}'
echo 'Major: ${{ env.BIRD_MAJOR_VERSION }}'
echo 'Minor: ${{ env.BIRD_MINOR_VERSION }}'
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
file: Containerfile.dev
build-args: |
BIRD_VERSION=${{ env.BIRD_SRC_VERSION }}
tags: |
ghcr.io/sonix-network/bird:dev-${{ env.BIRD_MAJOR_VERSION }}
ghcr.io/sonix-network/bird:dev-${{ env.BIRD_MAJOR_VERSION }}.${{ env.BIRD_MINOR_VERSION }}
ghcr.io/sonix-network/bird:dev-v${{ env.BIRD_VERSION }}
ghcr.io/sonix-network/bird:dev