hsflowd #69
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Local Build | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
REGISTRY: local | |
on: | |
push: | |
branches: | |
- '**' | |
- '!main' | |
pull_request: | |
branches: | |
- 'main' | |
jobs: | |
simple_base_images: | |
strategy: | |
matrix: | |
base_images: [alpine, debian, ubuntu] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3.4.0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build and export | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./base_images/ | |
file: ./base_images/${{ matrix.base_images }}.dockerfile | |
outputs: type=docker,dest=/tmp/${{ matrix.base_images }}.tar | |
tags: ${{ env.REGISTRY }}/${{ matrix.base_images }}:${{ env.BRANCH_NAME }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.base_images }} | |
path: /tmp/${{ matrix.base_images }}.tar | |
simple_singlestage_images_alpine: | |
needs: simple_base_images | |
strategy: | |
matrix: | |
singlestage_images: [ab, apache, coredns, frr, ipv6, quagga, traefik, wireguard, sflowrt] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3.4.0 | |
# https://github.com/docker/setup-buildx-action | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: alpine | |
path: /tmp | |
- name: Load image | |
run: | | |
docker load --input /tmp/alpine.tar | |
docker image ls -a | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
driver: docker | |
- name: Build and export | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./singlestage_images/ | |
file: ./singlestage_images/${{ matrix.singlestage_images }}.dockerfile | |
push: false | |
load: true | |
tags: ${{ env.REGISTRY }}/${{ matrix.singlestage_images }}:${{ env.BRANCH_NAME }} | |
build-args: | | |
image=${{ env.REGISTRY }}/alpine:${{ env.BRANCH_NAME }} | |
- name: List images | |
run: docker image ls -a | |
simple_singlestage_images_ubuntu: | |
needs: simple_base_images | |
strategy: | |
matrix: | |
singlestage_images: [p4] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3.4.0 | |
# https://github.com/docker/setup-buildx-action | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: ubuntu | |
path: /tmp | |
- name: Load image | |
run: | | |
docker load --input /tmp/ubuntu.tar | |
docker image ls -a | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
driver: docker | |
- name: Build and export | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./singlestage_images/ | |
file: ./singlestage_images/${{ matrix.singlestage_images }}.dockerfile | |
push: false | |
load: true | |
tags: ${{ env.REGISTRY }}/${{ matrix.singlestage_images }}:${{ env.BRANCH_NAME }} | |
build-args: | | |
image=${{ env.REGISTRY }}/ubuntu:${{ env.BRANCH_NAME }} | |
- name: List images | |
run: docker image ls -a | |
simple_multistage_images_alpine: | |
needs: simple_base_images | |
strategy: | |
matrix: | |
multistage_images: [softether, whoami, ovs] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3.4.0 | |
# https://github.com/docker/setup-buildx-action | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: alpine | |
path: /tmp | |
- name: Load image | |
run: | | |
docker load --input /tmp/alpine.tar | |
docker image ls -a | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
driver: docker | |
- name: Build and export | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./multistage_images/ | |
file: ./multistage_images/${{ matrix.multistage_images }}.dockerfile | |
push: false | |
load: true | |
tags: ${{ env.REGISTRY }}/${{ matrix.multistage_images }}:${{ env.BRANCH_NAME }} | |
build-args: | | |
image=${{ env.REGISTRY }}/alpine:${{ env.BRANCH_NAME }} | |
- name: List images | |
run: docker image ls -a | |
simple_multistage_images_debian: | |
needs: simple_base_images | |
strategy: | |
matrix: | |
multistage_images: [onos] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3.4.0 | |
# https://github.com/docker/setup-buildx-action | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: debian | |
path: /tmp | |
- name: Load image | |
run: | | |
docker load --input /tmp/debian.tar | |
docker image ls -a | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
driver: docker | |
- name: Build and export | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./multistage_images/ | |
file: ./multistage_images/${{ matrix.multistage_images }}.dockerfile | |
push: false | |
load: true | |
tags: ${{ env.REGISTRY }}/${{ matrix.multistage_images }}:${{ env.BRANCH_NAME }} | |
build-args: | | |
image=${{ env.REGISTRY }}/debian:${{ env.BRANCH_NAME }} | |
- name: List images | |
run: docker image ls -a |