-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yaml
85 lines (79 loc) · 2.15 KB
/
action.yaml
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
82
83
84
85
name: Container
description: >
Builds cointainers from uploaded artifacts
inputs:
dockerfile:
description: "The Dockerfile to use"
required: true
default: "./Dockerfile.gh"
archs:
description: "Architectures to build"
required: true
default: "386, amd64, arm64, arm"
repository:
description: "repository name"
required: true
registry:
description: "registry name"
required: true
default: docker.io/withlazers
username:
description: "username for registry"
required: true
default: "withlazers"
password:
description: "password for registry"
required: true
tags:
description: "tags to push"
required: true
default: sha-${{ github.sha }} latest
ref-tags:
description: "reference tags tags to push"
required: true
default: ${{ github.ref_name }}
runs:
using: composite
steps:
- name: Install qemu dependency
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Download all Artifact
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Extract Artifact
shell: bash
run: |
for d in artifacts/*/; do
tar -C "$d" -xf "$d/"*.tar.gz
done
ln -sr artifacts/{i686,x86}-unknown-linux-musl
ln -sr artifacts/{x86_64,amd64}-unknown-linux-musl
ln -sr artifacts/armv7-unknown-linux-musl{eabihf,}
ln -sr artifacts/{aarch64,arm64}-unknown-linux-musl
- name: List artifacts
shell: bash
run: |
find artifacts
- name: Build Docker Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
archs: ${{ inputs.archs }}
image: ${{ inputs.repository }}
tags: >
${{ inputs.tags }}
${{ inputs.ref-tags }}
containerfiles: ${{ inputs.dockerfile }}
- name: Push to Dockerhub
if: startsWith(github.ref, 'refs/tags/v')
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ${{ inputs.registry }}
username: ${{ inputs.username }}
password: ${{ inputs.password }}