-
Notifications
You must be signed in to change notification settings - Fork 47
111 lines (98 loc) · 3.72 KB
/
desktops.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
name: Desktops
on:
workflow_dispatch:
push:
tags: [v*]
env:
IMAGE_PREFIX: ghcr.io/webmeshproj/desktop
PLATFORMS: linux/amd64,linux/arm64
ARCHS: amd64,arm64
VERSION: latest
COSIGN_EXPERIMENTAL: 1
jobs:
build:
name: Build Images
runs-on: self-hosted
permissions:
contents: "write"
id-token: "write"
packages: "write"
strategy:
fail-fast: false
matrix:
docker-context:
- build/desktops/ubuntu
- build/desktops/app-profiles
- build/desktops/dosbox
include:
- name: Ubuntu Base Image
docker-context: build/desktops/ubuntu
dockerfile: Dockerfile.base
tag-suffix: ubuntu-base
cache-dep-path: build/desktops/ubuntu/Dockerfile.base
- name: App Base Image
docker-context: build/desktops/app-profiles
dockerfile: Dockerfile.base
tag-suffix: apps-base
cache-dep-path: build/desktops/app-profiles/Dockerfile.base
- name: DOSBox Image
docker-context: build/desktops/dosbox
dockerfile: Dockerfile.base
tag-suffix: dosbox-base
cache-dep-path: build/desktops/dosbox/Dockerfile.base
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to GHCR
uses: docker/login-action@v3
if: ${{ github.event_name != 'pull_request' }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ env.ARCHS }}
- name: Setup Buildx
uses: docker/setup-buildx-action@v3
- name: Build ${{ matrix.name }}
uses: docker/build-push-action@v5
id: base-build
with:
context: ${{ matrix.docker-context }}
file: ${{ matrix.docker-context }}/${{ matrix.dockerfile }}
push: true
tags: ${{ env.IMAGE_PREFIX }}-${{ matrix.tag-suffix }}:${{ env.VERSION }}
platforms: ${{ env.PLATFORMS }}
cache-from: type=local,src=/home/runner/.${{ matrix.tag-suffix }}.buildx-cache
cache-to: type=local,dest=/home/runner/.${{ matrix.tag-suffix }}.buildx-cache
# Do the same again for Xfce4 and KDE if this is the ubuntu build
- name: Build ${{ matrix.name }} With Xfce4
uses: docker/build-push-action@v5
if: ${{ matrix.docker-context == 'build/desktops/ubuntu' }}
id: xfce4-build
with:
context: ${{ matrix.docker-context }}
file: ${{ matrix.docker-context }}/Dockerfile.desktop
push: true
tags: ${{ env.IMAGE_PREFIX }}-${{ matrix.tag-suffix }}-xfce4:${{ env.VERSION }}
platforms: ${{ env.PLATFORMS }}
cache-from: type=local,src=/home/runner/.${{ matrix.tag-suffix }}.buildx-cache
cache-to: type=local,dest=/home/runner/.${{ matrix.tag-suffix }}.buildx-cache
build-args: DESKTOP_PACKAGE=xfce4
- name: Build ${{ matrix.name }} With KDE
uses: docker/build-push-action@v5
if: ${{ matrix.docker-context == 'build/desktops/ubuntu' }}
id: kde-build
with:
context: ${{ matrix.docker-context }}
file: ${{ matrix.docker-context }}/Dockerfile.desktop
push: true
tags: ${{ env.IMAGE_PREFIX }}-${{ matrix.tag-suffix }}-kde:${{ env.VERSION }}
platforms: ${{ env.PLATFORMS }}
cache-from: type=local,src=/home/runner/.${{ matrix.tag-suffix }}.buildx-cache
cache-to: type=local,dest=/home/runner/.${{ matrix.tag-suffix }}.buildx-cache
build-args: DESKTOP_PACKAGE=kde-standard