-
Notifications
You must be signed in to change notification settings - Fork 53
84 lines (76 loc) · 2.53 KB
/
Copy pathdeps-image.yml
File metadata and controls
84 lines (76 loc) · 2.53 KB
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
name: Build Dependency Image
on:
schedule:
- cron: '0 0 * * 0' # Weekly on Sunday at midnight UTC
workflow_dispatch: # Allow manual trigger
push:
paths:
- '*.cabal'
- 'cabal.project*'
- 'Dockerfile.deps'
- 'package*.json'
- 'web-components/package*.json'
- 'web-components/src/chart-cli.ts'
branches: [master]
jobs:
build-deps:
name: Build Dependencies Image (${{ matrix.platform }})
runs-on: ${{ matrix.runner }}
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
include:
- platform: linux/amd64
runner: blacksmith-4vcpu-ubuntu-2404
- platform: linux/arm64
runner: blacksmith-4vcpu-ubuntu-2404-arm
steps:
- uses: actions/checkout@v6
- name: Free Disk Space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
- name: Setup Blacksmith Builder
uses: useblacksmith/setup-docker-builder@v1
- name: Login to Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_TOKEN }}
- name: Build and push platform image
uses: useblacksmith/build-push-action@v2
with:
context: .
file: ./Dockerfile.deps
push: true
tags: ghcr.io/monoscope-tech/monoscope-deps:${{ github.sha }}-${{ matrix.platform == 'linux/amd64' && 'amd64' || 'arm64' }}
platforms: ${{ matrix.platform }}
provenance: false
merge-manifest:
name: Merge Multi-Arch Manifest
needs: build-deps
runs-on: blacksmith-4vcpu-ubuntu-2404
permissions:
contents: read
packages: write
steps:
- name: Login to Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_TOKEN }}
- name: Create and push multi-arch manifest
run: |
docker buildx imagetools create \
--tag ghcr.io/monoscope-tech/monoscope-deps:latest \
--tag ghcr.io/monoscope-tech/monoscope-deps:${{ github.sha }} \
ghcr.io/monoscope-tech/monoscope-deps:${{ github.sha }}-amd64 \
ghcr.io/monoscope-tech/monoscope-deps:${{ github.sha }}-arm64