Skip to content

Commit

Permalink
github: Build master daily docker images and for stable/X.Y on push
Browse files Browse the repository at this point in the history
frrouting/frr:master will be generated every day
frrouting/frr:vX.Y.Z will be generated every time a new push is done on the
stable/X.Y branch.

Takes up to 3 hours to build and publish images.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
  • Loading branch information
ton31337 committed Dec 4, 2022
1 parent 784ca77 commit 5772fdf
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/docker-daily-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build daily 'master' images for Docker

on:
schedule:
- cron: '59 23 * * *'

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
docker_daily_master:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Custom variables
id: vars
run: |
# To package a specific git commit, the date of the commit gets
# appended to the latest release, e.g. 1.0.0_git20180204.
# This is the requirement by APKBUILD (abuild).
# More details: https://wiki.alpinelinux.org/wiki/APKBUILD_Reference.
echo ::set-output name=date::$(date +'%Y%m%d')
- name: Checkout
uses: actions/checkout@v3
with:
ref: master

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: ./docker/alpine/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/frr:master
build-args: PKGVER=${{ steps.vars.outputs.date }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
52 changes: 52 additions & 0 deletions .github/workflows/docker-stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build stable branch images for Docker

on:
push:
branches:
- 'stable/**'

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
docker_daily_master:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Custom variables
id: vars
run: |
# To package a specific git commit, the date of the commit gets
# appended to the latest release, e.g. 1.0.0_git20180204.
# This is the requirement by APKBUILD (abuild).
# More details: https://wiki.alpinelinux.org/wiki/APKBUILD_Reference.
echo ::set-output name=date::$(date +'%Y%m%d')
# Get the real version specified in configure.ac file.
echo ::set-output name=frr_version::$(grep AC_INIT configure.ac | cut -d '[' -f3 | cut -d ']' -f 1)
- name: Checkout
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: ./docker/alpine/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/frr:v${{ steps.vars.outputs.frr_version }}
build-args: PKGVER=${{ steps.vars.outputs.date }}
platforms: linux/amd64,linux/arm64,linux/arm/v7

0 comments on commit 5772fdf

Please sign in to comment.