-
Notifications
You must be signed in to change notification settings - Fork 19
42 lines (37 loc) · 1.2 KB
/
build-and-push-to-registry.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Container image builder workflow
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: gh-ref-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-push-images:
if: ${{ github.repository == 'pine64/OpenPineBuds' }}
name: Build and push container image for PineBuds Pro SDK to GHCR.io
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install qemu dependency
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Build images
id: build
uses: redhat-actions/buildah-build@v2
with:
image: ${{ github.repository }}
platforms: linux/amd64, linux/arm64
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 }}