Skip to content

Build and Push ubuntu-rust-gtk4 #1

Build and Push ubuntu-rust-gtk4

Build and Push ubuntu-rust-gtk4 #1

Workflow file for this run

name: Build and Push Ubuntu-rust-gtk4
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "docker"
schedule:
- cron: "15 8 1 */1 *"
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
fail-fast: false
matrix:
include:
- platform: amd64
arch: amd64
- platform: arm64
arch: arm64v8
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Github Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Metadata
run: |
echo "OWNER=${GITHUB_REPOSITORY_OWNER@L}" >> ${GITHUB_ENV}
- name: Build and push for ${{ matrix.platform }}
uses: docker/build-push-action@v6
with:
context: docker
platforms: linux/${{ matrix.platform }}
push: true
tags: |
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:${{ matrix.platform }}
build-args: |
ARCH=${{ matrix.arch }}
provenance: false
merge:
needs: build-and-push
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
fail-fast: false
steps:
- name: Login to Github Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Metadata
id: date
run: |
echo "OWNER=${GITHUB_REPOSITORY_OWNER@L}" >> ${GITHUB_ENV}
echo "date=$(date --rfc-3339=date)" >> ${GITHUB_OUTPUT}
- name: Create multi-arch manifest for latest tag
run: |
docker manifest create ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:latest \
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:amd64 \
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:arm64
docker manifest annotate ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:latest \
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:amd64 --arch amd64
docker manifest annotate ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:latest \
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:arm64 --arch arm64
docker manifest push ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:latest
- name: Create multi-arch manifest for date tag
run: |
docker manifest create ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:${{ steps.date.outputs.date }} \
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:amd64 \
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:arm64
docker manifest annotate ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:${{ steps.date.outputs.date }} \
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:amd64 --arch amd64
docker manifest annotate ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:${{ steps.date.outputs.date }} \
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:arm64 --arch arm64
docker manifest push ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:${{ steps.date.outputs.date }}
- name: Check push
run: |
docker buildx imagetools inspect ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:latest