-
Notifications
You must be signed in to change notification settings - Fork 9
120 lines (103 loc) · 3.78 KB
/
cr.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Container Registry
on:
push:
branches: [main]
paths: [Dockerfile]
pull_request:
branches: [main]
paths: [Dockerfile]
schedule:
# Once a week
- cron: "0 0 * * */7"
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
services:
registry:
image: registry:latest
ports:
- 5000:5000
strategy:
matrix:
runtime:
- name: freedesktop
tag: 23.08
packages: org.freedesktop.Platform/x86_64/23.08 org.freedesktop.Sdk/x86_64/23.08 org.freedesktop.Platform/aarch64/23.08 org.freedesktop.Sdk/aarch64/23.08
remote: flathub
- name: freedesktop
tag: 22.08
packages: org.freedesktop.Platform/x86_64/22.08 org.freedesktop.Sdk/x86_64/22.08 org.freedesktop.Platform/aarch64/22.08 org.freedesktop.Sdk/aarch64/22.08
remote: flathub
- name: gnome
tag: 44
packages: org.gnome.Platform/x86_64/44 org.gnome.Sdk/x86_64/44 org.gnome.Platform/aarch64/44 org.gnome.Sdk/aarch64/44
remote: flathub
- name: gnome
tag: 45
packages: org.gnome.Platform/x86_64/45 org.gnome.Sdk/x86_64/45 org.gnome.Platform/aarch64/45 org.gnome.Sdk/aarch64/45
remote: flathub
- name: gnome
tag: master
packages: org.gnome.Platform/x86_64/master org.gnome.Sdk/x86_64/master org.gnome.Platform/aarch64/master org.gnome.Sdk/aarch64/master
remote: gnome-nightly
- name: kde
tag: 5.15-22.08
packages: org.kde.Platform/x86_64/5.15-22.08 org.kde.Sdk/x86_64/5.15-22.08 org.kde.Platform/aarch64/5.15-22.08 org.kde.Sdk/aarch64/5.15-22.08
remote: flathub
- name: elementary
tag: juno-22.08
packages: io.elementary.BaseApp//juno-22.08 org.freedesktop.Platform//22.08 org.freedesktop.Sdk//22.08
remote: flathub
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
- name: Setup Cache
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build Base Image
uses: docker/build-push-action@v5
with:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
file: Dockerfile
pull: true
push: true
tags: localhost:5000/flatter-base:latest
- name: Generate Dockerfile
run: |
cat >> ${{ matrix.runtime.name }}.Dockerfile << EOF
# syntax = docker/dockerfile:experimental
FROM localhost:5000/flatter-base:latest
RUN --security=insecure flatpak install -y --noninteractive \
${{ matrix.runtime.remote }} \
${{ matrix.runtime.packages }}
EOF
- name: Build
uses: docker/build-push-action@v5
with:
allow: security.insecure
context: .
file: ${{ matrix.runtime.name }}.Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/${{ github.repository }}/${{ matrix.runtime.name }}:${{ matrix.runtime.tag }}