Docker images #3
This file contains hidden or 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
on: | |
schedule: | |
- cron: "0 0 * * */7" # This should run every hour | |
workflow_dispatch: | |
name: Docker images | |
jobs: | |
build-images: | |
name: Build & push Docker images | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
runtime: | |
- name: gnome-nightly-with-wine | |
packages: | |
gnome-nightly: org.gnome.Platform//master org.gnome.Sdk//master org.gnome.Sdk.Compat.i386//master | |
flathub: org.winehq.Wine//stable-24.08 | |
services: | |
registry: | |
image: registry:latest | |
ports: | |
- 5000:5000 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2.2.1 | |
with: | |
driver-opts: network=host | |
- name: Cache Docker layers for the base image | |
uses: actions/cache@v3.2.0 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Build & push the Fedora base image to local registry | |
uses: docker/build-push-action@v3.2.0 | |
with: | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache | |
context: . | |
file: Dockerfile | |
pull: true | |
push: true | |
tags: localhost:5000/fedora-base:latest | |
- name: Log in to the Container registry | |
uses: docker/login-action@v2.1.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Write the Dockerfile for the ${{ matrix.runtime.name }} runtime | |
run: | | |
cat >> ${{ matrix.runtime.name }}.Dockerfile << EOF | |
# syntax = docker/dockerfile:experimental | |
FROM localhost:5000/fedora-base:latest | |
RUN --security=insecure flatpak install gnome-nightly -y --noninteractive ${{ matrix.runtime.packages.gnome-nightly }} | |
RUN --security=insecure flatpak install flathub -y --noninteractive ${{ matrix.runtime.packages.flathub }} | |
- name: Build & push the ${{ matrix.runtime.name }} image to Docker Hub | |
uses: docker/build-push-action@v3.2.0 | |
with: | |
allow: security.insecure | |
context: . | |
file: ${{ matrix.runtime.name }}.Dockerfile | |
push: true | |
tags: ghcr.io/${{ github.repository }}:${{ matrix.runtime.name }} |