diff --git a/.github/workflows/Container.yaml b/.github/workflows/Container.yaml new file mode 100644 index 00000000..d705a4a2 --- /dev/null +++ b/.github/workflows/Container.yaml @@ -0,0 +1,29 @@ +name: Container + +on: + - push + +env: + REGISTRY: ghcr.io + IMAGE_NAME: softvare-group/d4v2 + TAG: ${{ github.ref_name }} + +jobs: + Build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Nix + uses: DeterminateSystems/nix-installer-action@v10 + - name: Cache + uses: DeterminateSystems/magic-nix-cache-action@v4 + - name: Build + run: nix build -L .#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 + - name: Push latest tag + if: ${{ github.ref_type == 'tag' }} + run: nix run nixpkgs#skopeo -- copy docker://$REGISTRY/$IMAGE_NAME:$TAG docker://$REGISTRY/$IMAGE_NAME:latest diff --git a/flake.nix b/flake.nix index 801333d2..5fd741c3 100644 --- a/flake.nix +++ b/flake.nix @@ -51,7 +51,14 @@ container = pkgs.dockerTools.buildLayeredImage { name = "d4v2"; contents = [ self.packages.${system}.d4 ]; - config.Entrypoint = [ "/bin/d4" ]; + config = { + Entrypoint = [ "/bin/d4" ]; + Labels = { + "org.opencontainers.image.source" = "https://github.com/SoftVarE-Group/d4v2"; + "org.opencontainers.image.description" = "A CNF to d-DNNF compiler"; + "org.opencontainers.image.licenses" = "LGPL-2.1-or-later"; + }; + }; }; mt-kahypar = pkgs.stdenv.mkDerivation {