feat: refactor statistics to create serialisable data structures #209
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Container | |
on: | |
- push | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: softvare-group/ddnnife | |
TAG: ${{ github.ref_name }} | |
jobs: | |
Build: | |
strategy: | |
matrix: | |
target: | |
- double: aarch64-linux # target we are building for | |
architecture: arm64 # container architecture label | |
runner: ubuntu-24.04-arm # GitHub runner the build is running on | |
- double: x86_64-linux | |
architecture: amd64 | |
runner: ubuntu-24.04 | |
runs-on: ${{ matrix.target.runner }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Nix | |
uses: DeterminateSystems/nix-installer-action@v16 | |
- name: Cache | |
uses: DeterminateSystems/magic-nix-cache-action@v9 | |
- name: Build | |
run: nix build -L .#container | |
- name: Container policy | |
run: | | |
nix build --out-link skopeo nixpkgs#skopeo | |
mkdir -p $HOME/.config/containers | |
cp skopeo/etc/containers/default-policy.json $HOME/.config/containers/policy.json | |
- 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 }} |