forgejo-actions/.github/workflows/build.yml
Tamipes 8b0f6d3d2d
Some checks failed
Build and Push docker image / buildAndPush (nix) (push) Failing after 40s
Build and Push docker image / buildAndPush (nix-host) (push) Failing after 3s
add .nix
2026-08-22 18:40:02 +02:00

40 lines
1.4 KiB
YAML

name: Build and Push docker image
on:
workflow_dispatch:
workflow_call:
push:
branches:
- main
- "*"
jobs:
buildAndPush:
runs-on: [ nix-host ]
strategy:
fail-fast: false
matrix:
containers: ["nix", "nix-host"]
steps:
- uses: actions/checkout@v4
- name: Nix build
run: |
ls -la
pwd
mkdir -p .nix
echo "nix build --extra-experimental-features "flakes nix-command" .${{matrix.containers}} --debug"
HOME="/" nix build --extra-experimental-features "flakes nix-command" .${{matrix.containers}} --debug
- name: Setup skopeo
run: curl -o /etc/containers/policy.json --create-dirs https://raw.githubusercontent.com/containers/skopeo/refs/heads/main/default-policy.json
- name: Push Image
run: |
skopeo copy --dest-password "$UPLOAD_TOKEN" --dest-username "$USERNAME" "docker-archive://$(realpath result)" "docker://$IMG_URL:$(date --iso-8601)" && \
skopeo copy --dest-password "$UPLOAD_TOKEN" --dest-username "$USERNAME" "docker-archive://$(realpath result)" "docker://$IMG_URL"
env:
USERNAME: tamipes
UPLOAD_TOKEN: ${{ secrets.UPLOAD_TOKEN }}
IMG_URL: git.tami.moe/tamipes/${{matrix.containers}}
- name: niks3 pin
uses: https://git.tami.moe/actions/niks3-upload@main
with:
token: ${{ secrets.NIKS3_TOKEN }}
pin: containers.${{matrix.containers}}