2023-01-06 12:54:55 -06:00
|
|
|
name: Container image builder workflow
|
|
|
|
on:
|
|
|
|
push:
|
2023-07-02 14:03:19 -05:00
|
|
|
branches: [main]
|
2023-01-06 12:54:55 -06:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: gh-ref-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-and-push-images:
|
2023-06-15 12:07:17 -05:00
|
|
|
if: ${{ github.repository == 'pine64/OpenPineBuds' }}
|
2023-01-06 12:54:55 -06:00
|
|
|
name: Build and push container image for PineBuds Pro SDK to GHCR.io
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
2023-09-10 20:24:38 -05:00
|
|
|
uses: actions/checkout@v4
|
2023-01-06 12:54:55 -06:00
|
|
|
|
2024-01-25 16:47:47 -06:00
|
|
|
- name: Install qemu dependency
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y qemu-user-static
|
|
|
|
|
2023-01-06 12:54:55 -06:00
|
|
|
- name: Build images
|
|
|
|
id: build
|
|
|
|
uses: redhat-actions/buildah-build@v2
|
|
|
|
with:
|
|
|
|
image: ${{ github.repository }}
|
2024-01-25 16:47:47 -06:00
|
|
|
platforms: linux/amd64, linux/arm64
|
2023-01-06 12:54:55 -06:00
|
|
|
context: /
|
|
|
|
tags: ${{ contains(github.ref_name, 'main') && 'latest' || github.ref_name }}-sdk
|
|
|
|
containerfiles: /Dockerfile
|
|
|
|
|
|
|
|
- name: Push container
|
|
|
|
uses: redhat-actions/push-to-registry@v2
|
|
|
|
with:
|
|
|
|
image: ${{ steps.build.outputs.image }}
|
|
|
|
tags: ${{ steps.build.outputs.tags }}
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|