Skip to content

ubuntu2304

ubuntu2304 #16

Workflow file for this run

---
name: ubuntu-23.04
on:
pull_request:
push:
paths:
- 'ubuntu2304/**'
- '.github/workflows/ubuntu2304.yml'
schedule:
- cron: '10 6,15 * * 1,6'
workflow_dispatch:
jobs:
# Test the image builds and works correctly.
test:
name: Test ubuntu2304
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
steps:
- uses: actions/checkout@v2.6.0
- name: Test building image.
run: cd ubuntu2304 && docker build -t ubuntu2304 .
- name: Run the built image.
run: docker run --name test-container -d --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro ubuntu2304
# If on master branch, build and release image.
release:
name: Release
runs-on: ubuntu-latest
# needs: test
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2.6.0
- 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@v2.1.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image.
uses: docker/build-push-action@v3.2.0
with:
context: ubuntu2204/
file: ubuntu2204/Dockerfile
platforms: linux/amd64, linux/arm64
push: true
tags: |
${{ github.repository }}:ubuntu2304, buluma/docker-molecule-ubuntu2304:latest
ghcr.io/${{ github.repository }}:ubuntu2304