-
Notifications
You must be signed in to change notification settings - Fork 10
81 lines (70 loc) · 2.32 KB
/
imagebuilder-trigger.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# 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 }}