Blog

McMorris Cookbook

AppetizerHarvest PopcornJewell McMorris
Mix
---
2QuartPopcorn
0.5CupUnpopped Popcorn
2CupShoestring Potato Chips
---
Spread into 15 x 10 inch pan
---
Mix
0.33CupMargarine
1TspLemon Pepper
0.5TspGarlic Powder
0.25TspSalt
1TspDill Weed
1TspWorcestershire Sauce
---
Pour mixture over popcorn and stir
Bake at 350 degrees for 6 - 8 min
AppetizerJello JigglersJewell McMorris
Mix
---
4PackJell-o Brand Jell-o
2.5CupBoiling Apple Juice
---
Stir then pour into pan
Refrigerate until firm
AppetizerParmesan Onion CanapesJewell McMorris
Mix
---
1CupMayo
0.5CupOnion Minced
8OzParmesan Grated
1TbspMilk 2%
---
Spread onto rye bread
Place onto baking sheets
Broil for 2 - 3 min or until golden and bubbly
AppetizerBeth's DipBeth Stevens
Mix
---
1PintSour Cream
0.5TbspDry Onion Soup Mix
1TbspDill Weed
1PintMayo
0.5TbspBeau Monde
---
BeverageCocoa MixJewell McMorris
Mix
---
0.5LBNonfat Dry Milk
0.5CupGranulated Sugar
0.5CupCocoa
0.25TspSalt
---
BeverageHot Buttered RumJerri Stratton Young
Mix
---
1CupButter
2CupSugar Confectioner's
0.5TspNutmeg
2CupVanilla Ice Cream
2CupBrown Sugar
1TspCinnamon
0.5TspAllspice
---
Store in refrigerator
Use 2 Tea Per Cup Of Hot Water Or Rum
BeverageBahama MamaDorothy Chambers
Mix
---
1OzRum
1OzCoconut Milk
1OzLiqueur
8OzOrange Juice
---
BeverageTootsie RollJean Chambers Robertson
Fill Glass
---
0.5Of GlassIce Cubes
1PackJigger dark creme de cacao
0.5Of GlassOrange Juice
---
BeveragePunchJean Chambers Robertson
Mix
---
36OzTropical Fruit Punch
3LitersGinger Ale
10CupStrawberries
1Orange
---
BeverageFrozen Strawberry Daiquiri MixJean Chambers Robertson
Mix
---
2CupSugar
0.33CupLime Juice
---
Stir until the sugar is dissolved
Combine in blender with
1QuartStrawberries
---
Pour into ziplock bag
Freeze
Combine in blender with
3TbspRum
0.25CupFrozen Strawberry Daiquiri Mix
0.75CupIce
OR
3TbspRootbeer
1Banana
0.25CupFrozen Strawberry Daiquiri Mix
0.75CupIce
---
BreadBisquick PizzaJean Chambers Robertson
Heat up to 105 - 115 degrees
---
0.66CupWater
Dissolve
1PackYeast Active Dry
---
Stir in bisquick
Beat vigorously
Knead until smooth
Roll into circle
Spread
Chopped turkey
Sauteed green pepper
Onion
Sliced mushroom
Sliced tomato
---
Bake for 15 - 20 min or until crust is brown
BreadHeath's French BreadJewell McMorris
Combine
---
1PackYeast Active Dry
0.5CupWarm Water
1TbspVegetable Shortening
1TbspSugar
---
Stir Then Add
1CupWarm Water
---
Stir Then Add
4CupFlour
---
Stir 5 times every 10 minutes
Roll into loafs
Bake at 400 degrees for 20 - 30 min
BreadOrange RollsBeth Stevens
Mix
---
0.5CupSugar
2Bettens Eggs
1CupMilk 2%
0.5CupCorn Oil
---
Heat to luke warm then mix
2PackActive Dry Yeast
---
Add flour until dough is stiff but still sticky
Let rise in warm place
Roll out into spiral
Cover in orange juice
Then add powdered sugar and add butter
---
Bake at 400 for 15 - 20 min
Frost
Powdered Sugar
Butter
Orange Juice
---
BreadChurrosRibkah McMorris
Boil
---
1CupWater
2.5TspSugar
2TbspVegetable Oil
---
Add
1CupFlour
BreadPizza BallRibkah McMorris
Mix
---
2Egg
1CupFlour
0.25CupSalt
1.25CupWater
---
Add to taste
Cheese
Tomato Sauce
---
Bake at 450 until golden brown
BreadCrustRibkah McMorris
Mix
---
1.5CupFlour
1CupButter
8TbspWater
---
Bake at 450 until golden brown
BreadButtery Soft PretzelsRibkah McMorris
Mix
---
4TbspActive Dry Yeast
0.5CupSugar
1TspVegetable Oil
4CupWarm Water
5CupFlour
0.5CupBaking Soda
1TbspBaker Bonus
1TspSalt
---
Bake at 450 until golden brown
BreadRollsRikah McMorris
Mix
---
4TspYeast
2CupMilk
2TbspSalt
3TspSalt
1TbspBaker Bonus
4CupFlour
---
Bake at 450 until golden brown
BreadNo Yeast RollRibkah McMorris
Mix
---
1CupFlour
0.5CupMilk
2TbspMayo
1TbspBaker Bonus
1TbspSalt
---
Bake at 450 until golden brown
BreadAll Purpose BreadRibkah McMorris
Mix
---
1CupMilk
0.5CupSugar
Heat Up
2.5TspYeast
---
Cover Until Bubbling
Mix
6TbspButter
1TbspBaker Bonus
2Egg Yolk
3.5CupFlour
Salt
---
Bake at 450 until golden brown
BreadRhubarb MuffinsRibkah McMorris
Mix
---
1.25CupBrown Sugar
0.5CupOil
1Egg
0.5CupMilk 2%
1TspVinegar
2TspSalt
2.5CupFlour
2TspVanilla
1.5CupRhubarb Cut
---
Fill into muffin liners
Top With
0.5TspCinnamon
0.5CupSugar
1TbspButter
---
Bake for 20 - 25 at 350 degrees
BreadTaquitosRibkah McMorris
Fill Tortilla
---
8OzCream Cheese
1CupSharp Cheddar Cheese
0.5CupBacon Strips
3TbspRanch dressing
0.25CupChives
0.25CupGreen Onion
---
Bake at 450 until golden brown
BreadWaffleRibkah McMorris
Mix
---
1Egg
1TspSalt
0.25CupButter
2CupFlour
0.25CupSugar
---
Bake at 450 until golden brown
BreadPopoversRibkah McMorris
Mix
---
1CupMilk 2%
2Eggs
3TbspButter
1CupFlour
1TspSalt
---
Bake at 450 until golden brown
BreadStrawberry BreadJewell McMorris
Beat until light and fluffy
---
4Eggs
Blend
1CupVegetable Oil
1CupSugar
1TspBaking Soda
0.5TspSalt
1tbspOrange Zest
---
Mix Slowly
3CupFlour
3CupCut Strawberry
---
Pour into pan
Bake until brown ~ 60 - 70 min or use cake tester
Let set for 30 min
BreadRaisin Bran MuffinsJean Chambers Robertson
Mix
---
5CupFlour
3CupSugar
5TspBaking Soda
2TspSalt
15OzRaisin Bran Cereal
1QuartButtermilk
1CupVegetable Oil
4Eggs
---
Do not stir after battery is moist
Top with
Butter
Then top with
Cinnamon Sugar
---
Bake at 400 for 15 - 20
DessertRhubarb Cream PieDorthy Chambers
Mix
---
2Eggs
1.5CupSugar
0.33CupFlour
0.5TspNutmeg
0.33CupButter
4CupRhubarb
---
Fill in pie pan
Cover with pie crust
Bake at 450 for 10 min
Than bake at 350 for 30 min
DessertPeanut Butter BarsJewell McMorris
Mix
---
1.5CupPeanut Butter
0.5CupButter
1TbspSugar
---
Place graham cracker onto pan
Mold the mix onto the graham cracker
Pour
6OzChocolate
DessertApple FrittersElijah McMorris
Mix
---
2CupFlour
0.25CupSugar
2.25TspBaking Powder
1TspSalt
0.75CupMilk 2%
2Egg
2TbspButter
0.5TspVanilla
3CupCut Apple
---
Heat oil to 350
Fry batter until puffy and golden brown
DessertEgg CustardRibkah McMorris
Mix
---
0.25CupButter
0.66CupSugar
2Egg
0.75CupMilk
1TspVanilla
DessertPuddingRibkah McMorris
Mix
---
0.5CupSugar
0.25CupCocoa Powder
2.5TbspCorn Starch
2CupMilk 2%
1TbspButter
1TspVanilla
DessertBread PuddingRibkah McMorris
Mix
---
2Egg
0.5CupMilk
2CupBread
1TspSalt
---
Bake at 400 until golden brown
DessertCustard PieRibkah McMorris
Mix
---
4Egg
1TspSalt
1TspPepper
2.25CupMilk
1TspVanilla
1TbspSugar
1TspNutmeg
---
Bake at 400 until golden brown
DessertApple CrispJewell McMorris
Mix
---
0.75CupBrown Sugar
0.5CupFlour
0.5CupOat
0.75TspCinnamon
0.75TspNutmeg
0.33CupButter
---
Cut
4Apple
---
Cover apples in mix
Bake at 375 for 30 min
DessertPic CrustJewell McMorris
Mix
---
2CupFlour
1TspSalt
0.25CupWater
0.5TspCorn Starch
---
Add repeatedly until desired textered
1TspWater
DessertPineapple Upside Down CakeJewell McMorris
Mix
---
1.5CupFlour
1CupSugar
2TbspBaking Powder
0.5TspSalt
0.5CupShortening
0.66CupMilk 2%
1TspVanila
---
Beat in
1Egg
---
Beat
Bake at 350 for 40 min
DessertTiramisuJewell McMorris
Mix
---
8OzSour Cream
8OzCream Cheese
0.66CupSugar
0.25CupMilk
1TspVanila
2TbspCoffee
---
Layer with graham crackers
DessertMarshmallow TreatsOleta Niderost
Mix
---
2QuartButter
4CupMarshmallows
5CupRice Krispies
---
Bake at 400 until melted
DessertNut Praline SquaresOleta Niderost
MIx
---
0.75CupFlour
0.5CupOatmeal Raw
0.5CupPowdered Sugar
0.33CupButter
---
Topping Mix
0.33CupButter
0.75CupBrown Sugar
1TspCinnamon
0.75CupWalnuts
---
Bake at 325 for 25 MIn
DessertVelVet FrostingJewell McMorris
Mix
---
5TbspFlour
1CupMilk 2%
---
Cook until thick
Let cool
Mix
1CupButter
1CupSugar
1TspVanilla
DessertChocolate Chip CookiesJewell McMorris
Mix
---
0.75CupVegetable Shortening
1CupBrown Sugar
2TbspMilk 2%
1TspVanilla
---
Beat
1Egg
---
Mix
1.5CupFlour
1TspSalt
0.75TspBaking Soda
8OzChocolate Chips
1CupPecan Or Walnuts
---
Bake at 375 8 - 10 min
DessertBon BonsJewell McMorris
Mix
---
13OzMilk 2%
18OzChocolate
32OzSugar Confectioner
2CupWalnut
0.5CupButter
---
Put on wax paper
Bake at 350 for 5 Min
Refrigerate until firm
DessertDouble Layer Pumpkin PieJean Chambers Robertson
Mix
---
4OzCream Cheese
1TbspHalf And Half
1TbspSugar
1.5CupCool Whip
---
Spread Into Pie Crust
Mix
1CupHalf And Half
2PackVanilla Pudding Mix
---
Add
2CupPumkin
1TspCinnamon
1TspCloves
0.5TspGinger
---
Spread Into Pie Crust
Top With Cool Whip
DessertSushi RiceRibkah McMorris
Mix
---
2CupRice
3TspWine
3tbspSugar
1.5TspSalt
DessertBrowniesJewell McMorris
Mix
---
2Egg
1.5tspVanilla Extract
0.5CupFlour
1CupSugar
1.5CupButter
1CupWalnuts
DessertCrab WrapRibkah McMorris
Mix
---
Crab
Cream Cheese
Green Onion
1TspWorcester
1TspSugar
Salt
GravyTurkey A La KingJewell McMorris
Cook on low heat untill bubbling
---
3/4CupButter
3/4CupFlour
Salt
Pepper
---
Remove from heat and stir
3CupTurkey Broth
2CupMilk
---
Boil for 1 min
Stir constantly
Add
2CupTurkey
2CupMushroom
1CupGreen Pepper
1/2CupPimiento

Pushing container images in Forgejo actions

Pushing container images

With GitHub actions most people use docker push to push their images to a registry.

With Forgejo actions, that probably won't work. because of docker-in-docker. Instead, you can use the skopeo to push your images to a registry.

To Setup CONTAINER_TOKEN:

  • create a token https://git.example.com/user/settings/applications
  • then add the token to your secrets https://forgejo.example.com/user/settings/actions/secrets

Note:

Forgejo create a Automatic token with each workflow run.

But you can't use it to push images to a registry.

name: docker

on:
  push:
    branches: [main]

env:
  REGISTRY: git.nexveridian.com
  IMAGE_NAME: ${{ github.repository }}
  NIX_CONFIG: "experimental-features = nix-command flakes"
  CONTAINER_TOKEN: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}

jobs:
  build:
    runs-on: nix
    permissions:
      contents: read
      packages: write
      id-token: write

    steps:
      - run: nix run -I nixpkgs=channel:nixos-unstable nixpkgs#attic-client login nex https://nix.example.com ${{ secrets.ATTIC_TOKEN }} || true
      - run: nix run -I nixpkgs=channel:nixos-unstable nixpkgs#attic-client cache create <cache name> || true
      - run: nix run -I nixpkgs=channel:nixos-unstable nixpkgs#attic-client cache configure <cache name> -- --priority 30 || true
      - run: nix run -I nixpkgs=channel:nixos-unstable nixpkgs#attic-client use <cache name> || true

      - name: Install Node.js
        run: |
          mkdir -p ~/.local/bin
          nix build -I nixpkgs=channel:nixos-unstable nixpkgs#nodejs_24 -o ~/.local/nodejs
          ln -sf ~/.local/nodejs/bin/node ~/.local/bin/node
          ln -sf ~/.local/nodejs/bin/npm ~/.local/bin/npm
          echo "$HOME/.local/bin" >> $GITHUB_PATH

      - uses: actions/checkout@v4

      - name: Install skopeo
        run: |
          mkdir -p ~/.local/bin
          nix build -I nixpkgs=channel:nixos-unstable nixpkgs#skopeo -o ~/.local/skopeo
          ln -sf ~/.local/skopeo/bin/skopeo ~/.local/bin/skopeo
          echo "$HOME/.local/bin" >> $GITHUB_PATH

      - name: Build Nix package
        run: nix build .#my-docker

      - name: Prepare repository variables
        run: |
          echo "REPO=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
          echo "OWNER=${GITHUB_REPOSITORY_OWNER,,}" >> ${GITHUB_ENV}
          # Extract just the repository name (everything after the last slash)
          REPO_NAME=${GITHUB_REPOSITORY##*/}
          echo "IMAGE_NAME=${REPO_NAME,,}" >> ${GITHUB_ENV}

      - name: Setup skopeo policy and push image
        run: |
          # configure container policy to accept insecure registry
          mkdir -p ~/.config/containers
          cat > ~/.config/containers/policy.json <<EOF
          {
            "default": [{"type":"insecureAcceptAnything"}]
          }
          EOF

          # ensure all required directories exist with proper permissions
          mkdir -p /tmp/skopeo /var/tmp ~/.local/share/containers
          chmod 755 /tmp/skopeo /var/tmp || true

          # set multiple environment variables for skopeo temporary directories
          export TMPDIR=/tmp/skopeo
          export TMP=/tmp/skopeo
          export TEMP=/tmp/skopeo
          export XDG_RUNTIME_DIR=/tmp/skopeo

          # The Nix build creates a compressed tar.gz file, we need to extract it first
          cd /tmp/skopeo
          cp ${GITHUB_WORKSPACE}/result ./docker-image.tar.gz
          gunzip docker-image.tar.gz

          # Create authentication file for skopeo
          mkdir -p ~/.docker
          cat > ~/.docker/config.json <<EOF
          {
            "auths": {
              "${{ env.REGISTRY }}": {
                "auth": "$(echo -n "${{ github.actor }}:${{ env.CONTAINER_TOKEN }}" | base64 -w 0)"
              }
            }
          }
          EOF

          # Also create auth for containers directory
          mkdir -p ~/.config/containers
          cp ~/.docker/config.json ~/.config/containers/auth.json

          # Test registry connectivity
          skopeo login --username "${{ github.actor }}" --password "${{ env.CONTAINER_TOKEN }}" "${{ env.REGISTRY }}"

          # Push image using Personal Access Token
          skopeo copy \
            --dest-tls-verify=false \
            --tmpdir /tmp/skopeo \
            --dest-creds "${{ github.actor }}:${{ env.CONTAINER_TOKEN }}" \
            docker-archive:/tmp/skopeo/docker-image.tar \
            docker://${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:latest

      - name: Push to attic
        if: always()
        run: |
          nix shell nixpkgs/nixos-unstable#findutils nixpkgs/nixos-unstable#util-linux nixpkgs/nixos-unstable#coreutils -c bash -c '
            valid_paths=$(find /nix/store -maxdepth 1 -type d -name "*-*" | \
              head -1000 | \
              xargs -I {} -P $(nproc) sh -c "nix path-info \"\$1\" >/dev/null 2>&1 && echo \"\$1\"" _ {} | \
              tr "\n" " ")

            if [ -n "$valid_paths" ]; then
              for i in {1..10}; do
                nix run nixpkgs/nixos-unstable#attic-client push <cache name> $valid_paths && break || [ $i -eq 10 ] || sleep 5
              done
            fi
          '

Swapping from GitHub to Forgejo actions, with `Nix` based actions

Forgejo Actions

Most actions are the mostly the same, but some things, like concurrency groups don't work.

name: nix

on:
  pull_request:
    branches: [main]
  push:
  schedule:
    - cron: 0 0 * * 1

env:
  CARGO_TERM_COLOR: always
  NIX_CONFIG: "experimental-features = nix-command flakes"

jobs:
  check-dependencies:
    name: check-dependencies
    # Change to a valid Forgejo runner image
    # runs-on: ubuntu-latest
    runs-on: nix
    permissions:
      contents: read
      id-token: write
      actions: write

    steps:
      - run: nix run -I nixpkgs=channel:nixos-unstable nixpkgs#attic-client login <pick a name for server> https://nix.example.com ${{ secrets.ATTIC_TOKEN }} || true
      - run: nix run -I nixpkgs=channel:nixos-unstable nixpkgs#attic-client cache create <cache name> || true
      - run: nix run -I nixpkgs=channel:nixos-unstable nixpkgs#attic-client cache configure <cache name> -- --priority 30 || true
      - run: nix run -I nixpkgs=channel:nixos-unstable nixpkgs#attic-client use <cache name> || true

      # Install and configure Node.js, since it's not setup in the default nix
      - name: Install Node.js
        run: |
          mkdir -p ~/.local/bin
          nix build -I nixpkgs=channel:nixos-unstable nixpkgs#nodejs_24 -o ~/.local/nodejs
          ln -sf ~/.local/nodejs/bin/node ~/.local/bin/node
          ln -sf ~/.local/nodejs/bin/npm ~/.local/bin/npm
          echo "$HOME/.local/bin" >> $GITHUB_PATH

      - uses: actions/checkout@v5

      - run: nix build -I nixpkgs=channel:nixos-unstable nixpkgs#nix-fast-build

      - name: check
        run: |
          nix run -I nixpkgs=channel:nixos-unstable nixpkgs#nix-fast-build -- --no-nom --skip-cached

      - name: Push to attic
        if: always()
        run: |
          nix shell nixpkgs/nixos-unstable#findutils nixpkgs/nixos-unstable#util-linux nixpkgs/nixos-unstable#coreutils -c bash -c '
            valid_paths=$(find /nix/store -maxdepth 1 -type d -name "*-*" | \
              head -1000 | \
              xargs -I {} -P $(nproc) sh -c "nix path-info \"\$1\" >/dev/null 2>&1 && echo \"\$1\"" _ {} | \
              tr "\n" " ")

            if [ -n "$valid_paths" ]; then
              for i in {1..10}; do
                nix run nixpkgs/nixos-unstable#attic-client push <cache name> $valid_paths && break || [ $i -eq 10 ] || sleep 5
              done
            fi
          '

Forgejo Actions

# .runner
{
  "WARNING": "This file is automatically generated by act-runner. Do not edit it manually unless you know what you are doing. Removing this file will cause act runner to re-register as a new runner.",
  "id": 1,
  "uuid": "****",
  "name": "<runner name>",
  "token": "****",
  "address": "https://git.example.com",
  "labels": [
    "bookworm:docker://node:24-bookworm",
    "nix-base:docker://docker.nix-community.org/nixpkgs/nix-unstable:latest",
    "nix:docker://git.nexveridian.com/nexveridian/action-attic:latest"
  ]
}

Available runner images

  • bookworm: closest to GitHub actions
  • nix-base: for bootstrapping
  • nix: custom image with packages pre installed

Creating custom runner images

git clone ssh://[email protected]:222/NexVeridian/docker-nixpkgs.git

Create a copy of images/action-attic

{
  docker-nixpkgs,
  pkgs,
  attic-client,
  nodejs_24,
  nix-fast-build,
  # add more packages here
}:
(docker-nixpkgs.nix.override {
  nix = pkgs.nixVersions.latest;

  extraContents = [
    attic-client
    nodejs_24
    nix-fast-build
    # and the corresponding packages here
  ];
}).overrideAttrs
  (prev: {
    meta = (prev.meta or { }) // {
      description = "Forgejo action image, with Nix and Attic client";
    };
  })

Edit folder name in .forgejo/workflows/nix.yaml

- name: Build Nix package
  run: nix-build -A action-attic

Pushing docker container images

With GitHub actions most people use docker push to push their images to a registry.

With Forgejo actions, that probably won't work. because of docker-in-docker. Instead, you can use the skopeo to push your images to a registry.

To Setup CONTAINER_TOKEN:

  • create a token https://git.example.com/user/settings/applications
  • then add the token to your secrets https://forgejo.example.com/user/settings/actions/secrets
name: docker

on:
  push:
    branches: [main]

env:
  REGISTRY: git.nexveridian.com
  IMAGE_NAME: ${{ github.repository }}
  NIX_CONFIG: "experimental-features = nix-command flakes"
  CONTAINER_TOKEN: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}

jobs:
  build:
    runs-on: nix
    permissions:
      contents: read
      packages: write
      id-token: write

    steps:
      - run: nix run -I nixpkgs=channel:nixos-unstable nixpkgs#attic-client login nex https://nix.example.com ${{ secrets.ATTIC_TOKEN }} || true
      - run: nix run -I nixpkgs=channel:nixos-unstable nixpkgs#attic-client cache create <cache name> || true
      - run: nix run -I nixpkgs=channel:nixos-unstable nixpkgs#attic-client cache configure <cache name> -- --priority 30 || true
      - run: nix run -I nixpkgs=channel:nixos-unstable nixpkgs#attic-client use <cache name> || true

      - name: Install Node.js
        run: |
          mkdir -p ~/.local/bin
          nix build -I nixpkgs=channel:nixos-unstable nixpkgs#nodejs_24 -o ~/.local/nodejs
          ln -sf ~/.local/nodejs/bin/node ~/.local/bin/node
          ln -sf ~/.local/nodejs/bin/npm ~/.local/bin/npm
          echo "$HOME/.local/bin" >> $GITHUB_PATH

      - uses: actions/checkout@v4

      - name: Install skopeo
        run: |
          mkdir -p ~/.local/bin
          nix build -I nixpkgs=channel:nixos-unstable nixpkgs#skopeo -o ~/.local/skopeo
          ln -sf ~/.local/skopeo/bin/skopeo ~/.local/bin/skopeo
          echo "$HOME/.local/bin" >> $GITHUB_PATH

      - name: Build Nix package
        run: nix build .#my-docker

      - name: Prepare repository variables
        run: |
          echo "REPO=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
          echo "OWNER=${GITHUB_REPOSITORY_OWNER,,}" >> ${GITHUB_ENV}
          # Extract just the repository name (everything after the last slash)
          REPO_NAME=${GITHUB_REPOSITORY##*/}
          echo "IMAGE_NAME=${REPO_NAME,,}" >> ${GITHUB_ENV}

      - name: Setup skopeo policy and push image
        run: |
          # configure container policy to accept insecure registry
          mkdir -p ~/.config/containers
          cat > ~/.config/containers/policy.json <<EOF
          {
            "default": [{"type":"insecureAcceptAnything"}]
          }
          EOF

          # ensure all required directories exist with proper permissions
          mkdir -p /tmp/skopeo /var/tmp ~/.local/share/containers
          chmod 755 /tmp/skopeo /var/tmp || true

          # set multiple environment variables for skopeo temporary directories
          export TMPDIR=/tmp/skopeo
          export TMP=/tmp/skopeo
          export TEMP=/tmp/skopeo
          export XDG_RUNTIME_DIR=/tmp/skopeo

          # The Nix build creates a compressed tar.gz file, we need to extract it first
          cd /tmp/skopeo
          cp ${GITHUB_WORKSPACE}/result ./docker-image.tar.gz
          gunzip docker-image.tar.gz

          # Create authentication file for skopeo
          mkdir -p ~/.docker
          cat > ~/.docker/config.json <<EOF
          {
            "auths": {
              "${{ env.REGISTRY }}": {
                "auth": "$(echo -n "${{ github.actor }}:${{ env.CONTAINER_TOKEN }}" | base64 -w 0)"
              }
            }
          }
          EOF

          # Also create auth for containers directory
          mkdir -p ~/.config/containers
          cp ~/.docker/config.json ~/.config/containers/auth.json

          # Test registry connectivity
          skopeo login --username "${{ github.actor }}" --password "${{ env.CONTAINER_TOKEN }}" "${{ env.REGISTRY }}"

          # Push image using Personal Access Token
          skopeo copy \
            --dest-tls-verify=false \
            --tmpdir /tmp/skopeo \
            --dest-creds "${{ github.actor }}:${{ env.CONTAINER_TOKEN }}" \
            docker-archive:/tmp/skopeo/docker-image.tar \
            docker://${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:latest

      - name: Push to attic
        if: always()
        run: |
          nix shell nixpkgs/nixos-unstable#findutils nixpkgs/nixos-unstable#util-linux nixpkgs/nixos-unstable#coreutils -c bash -c '
            valid_paths=$(find /nix/store -maxdepth 1 -type d -name "*-*" | \
              head -1000 | \
              xargs -I {} -P $(nproc) sh -c "nix path-info \"\$1\" >/dev/null 2>&1 && echo \"\$1\"" _ {} | \
              tr "\n" " ")

            if [ -n "$valid_paths" ]; then
              for i in {1..10}; do
                nix run nixpkgs/nixos-unstable#attic-client push <cache name> $valid_paths && break || [ $i -eq 10 ] || sleep 5
              done
            fi
          '