Skip to content

ci: switch images from Docker Hub to GitHub Packages #1370

ci: switch images from Docker Hub to GitHub Packages

ci: switch images from Docker Hub to GitHub Packages #1370

Workflow file for this run

name: Nix
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
schedule:
# Run once per day
- cron: '0 0 * * *'
jobs:
build:
strategy:
# Keep building the other channels if one fails
fail-fast: false
matrix:
channel:
- nixos-unstable
- nixos-24.05
system:
- x86_64-linux
- aarch64-linux
registry:
- name: ghcr.io
image_prefix: nix-community/docker-nixpkgs
auth: "${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}"

Check failure on line 27 in .github/workflows/nix.yml

View workflow run for this annotation

GitHub Actions / Nix

Invalid workflow file

The workflow is not valid. .github/workflows/nix.yml (Line: 27, Col: 19): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.GITHUB_TOKEN .github/workflows/nix.yml (Line: 30, Col: 19): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.REGISTRY_AUTH
- name: ghcr.io
image_prefix: nixpkgs
auth: "${{ secrets.REGISTRY_AUTH }}"
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
extra-platforms = aarch64-linux
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Log in to the Container registry
if: "${{ matrix.registry.name == 'ghcr.io' }}"
uses: docker/[email protected]
with:
registry: ${{ matrix.registry.name }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: nix-shell --run ./ci.sh
env:
CI_PROJECT_PATH: '${{ matrix.registry.image_prefix }}'
CI_REGISTRY: '${{ matrix.registry.name }}'
CI_REGISTRY_AUTH: '${{ matrix.registry.auth }}'
NIXPKGS_CHANNEL: '${{ matrix.channel }}'
NIX_SYSTEM_NAME: '${{ matrix.system }}'
push-manifest-to-docker-hub:
needs: [build]
strategy:
fail-fast: false
matrix:
channel:
- nixos-unstable
- nixos-24.05
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
extra-platforms = aarch64-linux
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix-shell --run ./ci-manifests.sh
env:
CI_REGISTRY_AUTH: '${{ secrets.REGISTRY_AUTH }}'
NIXPKGS_CHANNEL: '${{ matrix.channel }}'
NIX_SYSTEM_NAME: '${{ matrix.system }}'