Skip to content

Bump actions/checkout from 2 to 4 #14

Bump actions/checkout from 2 to 4

Bump actions/checkout from 2 to 4 #14

name: Buildroot base
on:
push:
branches:
- master
pull_request:
branches:
- master
release:
types:
- created
workflow_dispatch:
inputs:
no_docker_cache:
description: 'Set this to a non-empty string to disable docker caching'
required: false
default: ''
env:
GH_PKG_PREFIX: docker.pkg.github.com/egraff/xplat-ci-images/
jobs:
buildroot_base:
name: Buildroot base
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Login to GitHub Package Registry
shell: bash
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login https://docker.pkg.github.com -u ${{ github.actor }} --password-stdin
- name: Pull cache images from GitHub Package Registry
if: ${{ github.event.inputs.no_docker_cache == '' }}
shell: bash
run: |
(
docker pull ${{ env.GH_PKG_PREFIX }}buildroot:latest &&
docker tag ${{ env.GH_PKG_PREFIX }}buildroot:latest buildroot
) || true
(
docker pull ${{ env.GH_PKG_PREFIX }}buildroot_with_dl_cache_build:latest &&
docker tag ${{ env.GH_PKG_PREFIX }}buildroot_with_dl_cache_build:latest buildroot_with_dl_cache_build
) || true
(
docker pull ${{ env.GH_PKG_PREFIX }}buildroot_with_dl_cache:latest &&
docker tag ${{ env.GH_PKG_PREFIX }}buildroot_with_dl_cache:latest buildroot_with_dl_cache
) || true
- name: Build buildroot base image
shell: bash
run: |
docker build . \
--tag buildroot \
--file resources/docker/buildroot.Dockerfile \
--cache-from buildroot
- name: Build buildroot_with_dl_cache_build image
shell: bash
run: |
docker build . \
--tag buildroot_with_dl_cache_build \
--file resources/docker/buildroot_with_dl_cache_build.Dockerfile \
--build-arg baseimage=buildroot \
--cache-from buildroot_with_dl_cache_build
- name: Build buildroot_with_dl_cache image
shell: bash
run: |
docker build . \
--tag buildroot_with_dl_cache \
--file resources/docker/buildroot_with_dl_cache.Dockerfile \
--build-arg buildimage=buildroot_with_dl_cache_build \
--build-arg baseimage=buildroot \
--cache-from buildroot_with_dl_cache
- name: Push to GitHub Packages
shell: bash
run: |
docker tag buildroot ${{ env.GH_PKG_PREFIX }}buildroot:$GITHUB_SHA
docker tag buildroot ${{ env.GH_PKG_PREFIX }}buildroot:latest
docker tag buildroot_with_dl_cache_build ${{ env.GH_PKG_PREFIX }}buildroot_with_dl_cache_build:$GITHUB_SHA
docker tag buildroot_with_dl_cache_build ${{ env.GH_PKG_PREFIX }}buildroot_with_dl_cache_build:latest
docker tag buildroot_with_dl_cache ${{ env.GH_PKG_PREFIX }}buildroot_with_dl_cache:$GITHUB_SHA
docker tag buildroot_with_dl_cache ${{ env.GH_PKG_PREFIX }}buildroot_with_dl_cache:latest
docker push ${{ env.GH_PKG_PREFIX }}buildroot:$GITHUB_SHA
docker push ${{ env.GH_PKG_PREFIX }}buildroot:latest
docker push ${{ env.GH_PKG_PREFIX }}buildroot_with_dl_cache_build:$GITHUB_SHA
docker push ${{ env.GH_PKG_PREFIX }}buildroot_with_dl_cache_build:latest
docker push ${{ env.GH_PKG_PREFIX }}buildroot_with_dl_cache:$GITHUB_SHA
docker push ${{ env.GH_PKG_PREFIX }}buildroot_with_dl_cache:latest