Build container image #7
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
# Build a Docker/Podman container with dash-mpd-cli and its external helper applications. | |
# We currently build for Linux/AMD64 and for Linux/aarch64. | |
name: Build container image | |
on: workflow_dispatch | |
env: | |
REGISTRY_USER: ${{ github.actor }} | |
REGISTRY_PASSWORD: ${{ github.token }} | |
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} | |
jobs: | |
build-push-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
name: Build and push container/Linux | |
steps: | |
- name: Install qemu | |
run: sudo apt install qemu-user-static | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Log in to ghcr.io | |
uses: redhat-actions/podman-login@v1 | |
with: | |
username: ${{ env.REGISTRY_USER }} | |
password: ${{ env.REGISTRY_PASSWORD }} | |
registry: ${{ env.IMAGE_REGISTRY }} | |
- name: Build container images with podman | |
id: build-image | |
run: | | |
podman manifest create dash-mpd-cli | |
podman build . -f etc/Containerfile_linux_amd64 --arch amd64 --tag dash-mpd-cli-linux-amd64 --manifest dash-mpd-cli | |
podman build . -f etc/Containerfile_linux_aarch64 --arch arm64/v8 --tag dash-mpd-cli-linux-aarch64 --manifest dash-mpd-cli | |
- name: Push container image | |
id: push-to-registry | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: dash-mpd-cli | |
tags: latest | |
registry: ${{ env.IMAGE_REGISTRY }} | |