forked from flatpak/flatpak-github-actions
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Push images to flathub-infra GHCR namespace
- Loading branch information
1 parent
b1ee00e
commit d1c2d06
Showing
1 changed file
with
17 additions
and
77 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
on: | ||
schedule: | ||
- cron: "0 0 * * */7" # This should run every hour | ||
- cron: "0 0 * * */7" | ||
workflow_dispatch: | ||
|
||
name: Docker images | ||
|
@@ -13,14 +13,6 @@ jobs: | |
strategy: | ||
matrix: | ||
runtime: | ||
- name: freedesktop-20.08 | ||
packages: org.freedesktop.Platform//20.08 org.freedesktop.Sdk//20.08 | ||
remote: flathub | ||
|
||
- name: freedesktop-21.08 | ||
packages: org.freedesktop.Platform//21.08 org.freedesktop.Sdk//21.08 | ||
remote: flathub | ||
|
||
- name: freedesktop-22.08 | ||
packages: org.freedesktop.Platform//22.08 org.freedesktop.Sdk//22.08 | ||
remote: flathub | ||
|
@@ -29,26 +21,6 @@ jobs: | |
packages: org.freedesktop.Platform//23.08 org.freedesktop.Sdk//23.08 | ||
remote: flathub | ||
|
||
- name: gnome-3.38 | ||
packages: org.gnome.Platform//3.38 org.gnome.Sdk//3.38 | ||
remote: flathub | ||
|
||
- name: gnome-40 | ||
packages: org.gnome.Platform//40 org.gnome.Sdk//40 | ||
remote: flathub | ||
|
||
- name: gnome-41 | ||
packages: org.gnome.Platform//41 org.gnome.Sdk//41 | ||
remote: flathub | ||
|
||
- name: gnome-42 | ||
packages: org.gnome.Platform//42 org.gnome.Sdk//42 | ||
remote: flathub | ||
|
||
- name: gnome-43 | ||
packages: org.gnome.Platform//43 org.gnome.Sdk//43 | ||
remote: flathub | ||
|
||
- name: gnome-44 | ||
packages: org.gnome.Platform//44 org.gnome.Sdk//44 | ||
remote: flathub | ||
|
@@ -57,18 +29,6 @@ jobs: | |
packages: org.gnome.Platform//45 org.gnome.Sdk//45 | ||
remote: flathub | ||
|
||
- name: gnome-nightly | ||
packages: org.gnome.Platform//master org.gnome.Sdk//master | ||
remote: gnome-nightly | ||
|
||
- name: kde-5.15 | ||
packages: org.kde.Platform//5.15 org.kde.Sdk//5.15 | ||
remote: flathub | ||
|
||
- name: kde-5.15-21.08 | ||
packages: org.kde.Platform//5.15-21.08 org.kde.Sdk//5.15-21.08 | ||
remote: flathub | ||
|
||
- name: kde-5.15-22.08 | ||
packages: org.kde.Platform//5.15-22.08 org.kde.Sdk//5.15-22.08 | ||
remote: flathub | ||
|
@@ -77,18 +37,6 @@ jobs: | |
packages: org.kde.Platform//5.15-23.08 org.kde.Sdk//5.15-23.08 | ||
remote: flathub | ||
|
||
- name: kde-6.2 | ||
packages: org.kde.Platform//6.2 org.kde.Sdk//6.2 | ||
remote: flathub | ||
|
||
- name: kde-6.3 | ||
packages: org.kde.Platform//6.3 org.kde.Sdk//6.3 | ||
remote: flathub | ||
|
||
- name: kde-6.4 | ||
packages: org.kde.Platform//6.4 org.kde.Sdk//6.4 | ||
remote: flathub | ||
|
||
- name: kde-6.5 | ||
packages: org.kde.Platform//6.5 org.kde.Sdk//6.5 | ||
remote: flathub | ||
|
@@ -97,10 +45,6 @@ jobs: | |
packages: org.kde.Platform//6.6 org.kde.Sdk//6.6 | ||
remote: flathub | ||
|
||
- name: elementary-juno | ||
packages: io.elementary.BaseApp//juno-20.08 org.gnome.Platform//3.38 org.gnome.Sdk//3.38 | ||
remote: flathub | ||
|
||
services: | ||
registry: | ||
image: registry:latest | ||
|
@@ -112,48 +56,44 @@ jobs: | |
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2.2.1 | ||
uses: docker/setup-buildx-action@v3 | ||
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] | ||
- name: Build & push the base image to local registry | ||
uses: docker/build-push-action@v5 | ||
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 | ||
tags: localhost:5000/base:latest | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2.1.0 | ||
- name: Login to ghcr.io | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
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 | ||
FROM localhost:5000/base:latest | ||
RUN --security=insecure flatpak install -y --noninteractive ${{matrix.runtime.remote}} ${{ matrix.runtime.packages }} | ||
- name: Build & push the ${{ matrix.runtime.name }} image to Docker Hub | ||
uses: docker/build-push-action@v3.2.0 | ||
uses: docker/build-push-action@v5 | ||
with: | ||
allow: security.insecure | ||
context: . | ||
file: ${{ matrix.runtime.name }}.Dockerfile | ||
push: true | ||
tags: bilelmoussaoui/flatpak-github-actions:${{ matrix.runtime.name }} | ||
tags: flathub-infra/flatpak-github-actions:${{ matrix.runtime.name }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |