forked from flatpak/flatpak-github-actions
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (66 loc) · 2.42 KB
/
docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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/[email protected]
with:
driver-opts: network=host
- name: Cache Docker layers for the base image
uses: actions/[email protected]
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/[email protected]
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/[email protected]
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/[email protected]
with:
allow: security.insecure
context: .
file: ${{ matrix.runtime.name }}.Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}:${{ matrix.runtime.name }}