Skip to content

21.04, hirsute

21.04, hirsute #1344

Workflow file for this run

---
name: 21.04, hirsute
on:
pull_request:
push:
paths:
- 'ubuntu2104/**'
- '.github/workflows/build-21.04.yml'
schedule:
- cron: '27 2,4 * * 0,4'
workflow_dispatch:
jobs:
# Test the image builds and works correctly.
test:
name: Test ubuntu2104
# runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Test building image.
run: cd ubuntu2104 && docker build -t docker-ubuntu-21 .
- name: Run the built image.
run: docker run --name test-container -d --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro docker-ubuntu-21
# - name: Verify Ansible is accessible in the built image.
# run: docker exec --tty test-container env TERM=xterm ansible --version
# If on master branch, build and release image.
release:
name: Release
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: buluma/setup-buildx-action@0.1.0
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Login to GitHub Container Registry
# uses: docker/login-action@v1
# with:
# registry: ghcr.io
# username: ${{ github.repository_owner }}
# password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image.
uses: docker/build-push-action@v2
with:
context: ubuntu2104/
file: ubuntu2104/Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
push: true
tags: |
${{ github.repository }}:21.04, ${{ github.repository }}:hirsute-20220612, ${{ github.repository }}:hirsute