Skip to content

Commit

Permalink
.github/workflows: Add Ubuntu images CD workflow
Browse files Browse the repository at this point in the history
Build and push when there are changes in `images/ubuntu` directory
or in the workflow itself.
As well as every other week (7th and 21st days of months to be precise).

#483

Signed-off-by: Ievgen Popovych <[email protected]>
  • Loading branch information
Jmennius committed Apr 3, 2023
1 parent a84a358 commit b58a774
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/ubuntu-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: "Images: Build and push Ubuntu toolbx images"

on:
push:
branches:
- main
paths:
- images/ubuntu/**
- .github/workflows/ubuntu-images.yaml
schedule:
- cron: '0 0 * * MON'

# Prevent multiple workflow runs from racing
concurrency: ${{ github.workflow }}

env:
latest_release: '22.04'

jobs:
build-and-push-images:
strategy:
matrix:
release: ['16.04', '18.04', '20.04', '22.04', '22.10']

runs-on: ubuntu-latest
steps:
- 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 Quay.io
uses: docker/login-action@v2
with:
registry: quay.io
username: 'jmennius+toolbox_test' # TODO: credentials
password: ${{ secrets.QUAY_TEST_ROBOT_TOKEN }}

- name: Build and push Ubuntu ${{ matrix.release }} toolbox image
uses: docker/build-push-action@v3
with:
context: images/ubuntu/${{ matrix.release }}
file: images/ubuntu/${{ matrix.release }}/Containerfile
platforms: linux/amd64,linux/arm64
push: true
no-cache: true
tags: quay.io/toolbx-images/ubuntu-toolbox:${{ matrix.release }}

- name: Push latest tag
if: env.latest_release == matrix.release
uses: docker/build-push-action@v3
with:
context: images/ubuntu/${{ matrix.release }}
file: images/ubuntu/${{ matrix.release }}/Containerfile
platforms: linux/amd64,linux/arm64
push: true
tags: quay.io/toolbx-images/ubuntu-toolbox:latest

0 comments on commit b58a774

Please sign in to comment.