-
Notifications
You must be signed in to change notification settings - Fork 2
40 lines (40 loc) · 1.18 KB
/
dockerx_qemu_rpi.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
name: Build and Push QEMU RPi Image
on:
push:
branches-ignore:
- none
paths:
- "qemu_rpi/**"
workflow_dispatch:
jobs:
build:
runs-on: self-hosted
timeout-minutes: 60
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set tag name based on branch
id: set_tag
run: |
if [[ "${{ github.ref_name }}" == "master" ]]; then
echo "tag=latest" >> $GITHUB_OUTPUT
else
GITHUB_REFNAME=${{ github.ref_name }}
BRANCH_NAME=${GITHUB_REFNAME//\//_}
echo "tag=latest-$BRANCH_NAME" >> $GITHUB_OUTPUT
fi
- name: Build and push
uses: docker/build-push-action@v5
with:
context: "qemu_rpi"
file: "qemu_rpi/Dockerfile"
platforms: linux/amd64,linux/arm64/v8
push: true
tags: hivesolutions/qemu_rpi:${{ steps.set_tag.outputs.tag }}