Build ImageBuilder images (trigger) #22568
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
# SPDX-License-Identifier: GPL-2.0-only | |
# | |
# Copyright (C) 2021 ImmortalWrt.org | |
name: Build ImageBuilder images (trigger) | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: "Source branch" | |
required: true | |
default: "master" | |
version: | |
description: "Release version" | |
required: true | |
default: "snapshot" | |
target: | |
description: "Target" | |
required: true | |
arch: | |
description: "Architecture" | |
required: true | |
jobs: | |
build: | |
name: Build ImageBuilder image for ${{ github.event.inputs.target }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Free disk spaces | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
docker rmi $(docker images -q) | |
sudo -E apt-get -y purge azure-cli dotnet* firefox ghc* google* llvm* moby* mongodb* openjdk* powershell zulu* | |
sudo -E apt-get -y autoremove --purge | |
sudo -E rm -rf $AGENT_TOOLSDIRECTORY /usr/local/lib/android /usr/share/dotnet | |
- name: Checkout docker repo | |
uses: actions/checkout@v4 | |
- name: Download ImageBuilder for ${{ github.event.inputs.target }} | |
run: ./download_files.sh ib | |
env: | |
TARGET: ${{ github.event.inputs.target }} | |
VERSION: ${{ github.event.inputs.version }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
driver: docker | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build base image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: ./Dockerfile.base | |
platforms: linux/amd64 | |
push: false | |
tags: immortalwrt:base | |
- name: Build and push ImageBuilder image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: ./Dockerfile.ib | |
platforms: linux/amd64 | |
push: true | |
tags: | | |
immortalwrt/imagebuilder:${{ github.event.inputs.target }}-${{ github.event.inputs.branch }} | |
immortalwrt/imagebuilder:${{ github.event.inputs.target }}-${{ github.event.inputs.version }} |