forked from crillab/d4v2
-
Notifications
You must be signed in to change notification settings - Fork 3
43 lines (40 loc) · 1.53 KB
/
Container.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
name: Container
on:
- push
env:
REGISTRY: ghcr.io
IMAGE_NAME: softvare-group/d4v2
TAG: ${{ github.ref_name }}
jobs:
Build:
strategy:
matrix:
target:
- double: aarch64-linux # target we are building for
architecture: arm64 # container architecture label
emulated: true # whether this build host is being emulated
- double: x86_64-linux
architecture: amd64
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: QEMU
if: ${{ matrix.target.emulated }}
run: sudo apt-get install -y qemu-user-static
- name: Nix
uses: DeterminateSystems/nix-installer-action@v14
with:
extra-conf: |
extra-platforms = ${{ matrix.target.double }}
- name: Cache
uses: DeterminateSystems/magic-nix-cache-action@v8
- name: Build
run: nix build -L .#packages.${{ matrix.target.double }}.container
- name: Login
run: nix run nixpkgs#skopeo -- login $REGISTRY --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }}
- name: Push
run: nix run nixpkgs#skopeo -- copy docker-archive:result docker://$REGISTRY/$IMAGE_NAME:$TAG-${{ matrix.target.architecture }}
- name: Push latest tag
if: ${{ github.ref_type == 'tag' }}
run: nix run nixpkgs#skopeo -- copy docker://$REGISTRY/$IMAGE_NAME:$TAG-${{ matrix.target.architecture }} docker://$REGISTRY/$IMAGE_NAME:latest-${{ matrix.target.architecture }}