-
-
Notifications
You must be signed in to change notification settings - Fork 5
58 lines (46 loc) · 1.62 KB
/
build-container.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
on:
workflow_dispatch:
inputs:
skip-cache:
type: boolean
description: Skip Cache
name: 🐳 Build & Publish Docker Image
jobs:
build-container:
strategy:
matrix:
arch: ["arm64", "amd64"]
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout
uses: actions/checkout@v4
- name: 🤖 Setup Qemu
uses: docker/setup-qemu-action@v3
with:
platforms: "arm64"
- name: 🐋 Setup Buildx
uses: docker/setup-buildx-action@v3
- name: 🦥 Cache Image
id: cache-image
uses: actions/cache@v4
with:
key: venmic-builder-cache-${{ matrix.arch }}
path: |
docker/venmic-builder-${{ matrix.arch }}.tar
- name: 🏗️ Build Image
if: steps.cache-image.outputs.cache-hit != 'true' && ${{ github.event.inputs.skip-cache != 'true' }}
run: |
cd docker
docker buildx build --platform=linux/${{ matrix.arch }} --tag venmic-builder-${{ matrix.arch }} --load .
docker save venmic-builder-${{ matrix.arch }} > venmic-builder-${{ matrix.arch }}.tar
- name: 🔐 Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: ♻️ Publish Images
run: |
docker load < docker/venmic-builder-${{ matrix.arch }}.tar
docker image tag venmic-builder-${{ matrix.arch }} ghcr.io/vencord/venmic-builder-${{ matrix.arch }}
docker push ghcr.io/vencord/venmic-builder-${{ matrix.arch }}:latest