Docker #893
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
--- | |
name: Docker | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 6 1/5 * *" | |
jobs: | |
publish_docker: | |
name: Publish Docker | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: | |
- x86_64 | |
- aarch64 | |
version: | |
- 'daily' | |
- '6.1' | |
- '7' | |
- '7.1' | |
- '7.2' | |
- '7.3' | |
- '8' | |
services: | |
registry: | |
image: registry:latest | |
ports: | |
- 5000:5000 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build & push the base image to local registry | |
uses: docker/build-push-action@v6.2.0 | |
with: | |
context: . | |
push: true | |
tags: localhost:5000/ubuntu-base:latest | |
- name: Write the Dockerfile for the ${{ matrix.version }}-${{ matrix.arch }} runtime | |
run: | | |
cat <<EOF > ${{ matrix.version }}-${{ matrix.arch }}.Dockerfile | |
# syntax = docker/dockerfile:experimental | |
FROM localhost:5000/ubuntu-base:latest | |
RUN flatpak install -y --noninteractive appcenter io.elementary.Platform/${{ matrix.arch }}/${{ matrix.version }} io.elementary.Sdk/${{ matrix.arch }}/${{ matrix.version }} | |
EOF | |
- name: Set additional tags for the default x86_64 runtimes | |
if: matrix.arch == 'x86_64' | |
run: | | |
echo "additional_tags=,ghcr.io/${{ github.repository }}/runtime:${{ matrix.version }}" >> $GITHUB_ENV | |
- name: Build & push the ${{ matrix.version }}-${{ matrix.arch }} image | |
uses: docker/build-push-action@v6.2.0 | |
with: | |
context: . | |
push: true | |
file: ${{ matrix.version }}-${{ matrix.arch }}.Dockerfile | |
tags: ghcr.io/${{ github.repository }}/runtime:${{ matrix.version }}-${{ matrix.arch }}${{ env.additional_tags }} |