Files
openwrt-docker/.github/workflows/build.yml
T
2024-09-04 12:09:16 +02:00

59 lines
1.4 KiB
YAML

name: Build generic Docker image
on:
push:
branches:
- master
tags:
- 'v*'
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
OPENWRT_VERSION: 23.05.4
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set environment variables
run: |
echo "GIT_HASH=`git rev-parse --short HEAD`" >> $GITHUB_ENV
cat $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login into Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
provenance: false
platforms: linux/arm64
build-args: OPENWRT_VERSION=${{ env.OPENWRT_VERSION }}
tags: |
albrechtloh/qemu-openwrt:latest
albrechtloh/qemu-openwrt:openwrt-${{ env.OPENWRT_VERSION }}-${{ env.GIT_HASH }}
localhost:5000/local/qemu-openwrt:latest
- name: Inspect
run: |
docker buildx imagetools inspect localhost:5000/local/qemu-openwrt:latest