Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Build a base image and push to GitHub Packages #101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
on:
schedule:
- cron: "0 0 * * */7" # This should run every hour
workflow_dispatch:

name: Container Images

jobs:
base-image:
name: Base Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Metadata
id: metadata
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
tags: |
# set latest tag for main branch
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=branch

- name: Login
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build
uses: docker/build-push-action@v3
with:
file: Containerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
10 changes: 10 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM registry.fedoraproject.org/fedora:latest

RUN dnf update -y && \
dnf install -y flatpak flatpak-builder git-lfs ccache zstd \
python3-aiohttp python3-tenacity python3-gobject \
dbus-daemon xorg-x11-server-Xvfb && \
dnf clean all && rm -rf /var/cache/dnf

ADD https://raw.githubusercontent.com/flatpak/flat-manager/master/flat-manager-client /usr/bin
RUN chmod +x /usr/bin/flat-manager-client