Update cachix/install-nix-action digest to 13d8dd5 #165
This file contains hidden or 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: build-base | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| paths: | |
| - flake.lock | |
| - .github/workflows/build-base.yaml | |
| branches: | |
| - develop | |
| - main | |
| push: | |
| paths: | |
| - flake.lock | |
| - .github/workflows/build-base.yaml | |
| tags: | |
| - v* | |
| branches: | |
| - develop | |
| - main | |
| jobs: | |
| build: | |
| # aarch64-linux: self-hosted runner with native build | |
| # x86_64-linux: GitHub-hosted runner | |
| runs-on: ${{ matrix.nix_system == 'aarch64-linux' && fromJSON('["self-hosted", "Linux", "ARM64"]') || 'ubuntu-24.04' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| nix_system: | |
| - "x86_64-linux" | |
| - "aarch64-linux" | |
| nix_channel: | |
| - "nixos-unstable" | |
| - "nixos-25.11" | |
| steps: | |
| - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 | |
| - name: Set up PATH for NixOS (self-hosted) | |
| if: matrix.nix_system == 'aarch64-linux' | |
| run: echo "/run/current-system/sw/bin" >> $GITHUB_PATH | |
| - name: Set up QEMU | |
| if: matrix.nix_system != 'aarch64-linux' | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - uses: cachix/install-nix-action@1ca7d21a94afc7c957383a2d217460d980de4934 # v31 | |
| if: matrix.nix_system != 'aarch64-linux' | |
| with: | |
| nix_path: nixpkgs=channel:${{matrix.nix_channel}} | |
| extra_nix_config: | | |
| filter-syscalls = false | |
| experimental-features = nix-command flakes | |
| extra-platforms = aarch64-linux | |
| - uses: DeterminateSystems/flakehub-cache-action@main | |
| - name: Nix Build Base Images | |
| run: | | |
| nix build '.#packages.${{matrix.nix_system}}.base-devcontainer."${{matrix.nix_channel}}"' | |
| - name: Login to Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Load to local registry and retag | |
| if: ${{ github.event.pull_request.base.repo.url == github.event.pull_request.head.repo.url }} | |
| run: | | |
| export derivation_name=$(nix derivation show '.#packages.${{matrix.nix_system}}.base-devcontainer."${{matrix.nix_channel}}"' | nix run nixpkgs#jq -- '(.derivations // . ) | to_entries | .[0].value.outputs.out.path' -r | sed 's/^/\/nix\/store\//; s/^\/nix\/store\/\/nix\/store\//\/nix\/store\//') | |
| export tag=$(cat $derivation_name | docker load | awk '{print $3}') | |
| docker tag $tag ghcr.io/lucernae/devcontainer-nix:base--${{matrix.nix_channel}}---${{matrix.nix_system}} | |
| docker push ghcr.io/lucernae/devcontainer-nix:base--${{matrix.nix_channel}}---${{matrix.nix_system}} | |
| manifests-create: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.pull_request.base.repo.url == github.event.pull_request.head.repo.url }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| nix_channel: | |
| - "nixos-unstable" | |
| - "nixos-25.11" | |
| needs: | |
| - build | |
| steps: | |
| - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 | |
| - name: Login to Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create manifests | |
| run: | | |
| docker manifest create ghcr.io/lucernae/devcontainer-nix:base--${{matrix.nix_channel}} \ | |
| --amend ghcr.io/lucernae/devcontainer-nix:base--${{matrix.nix_channel}}---x86_64-linux \ | |
| --amend ghcr.io/lucernae/devcontainer-nix:base--${{matrix.nix_channel}}---aarch64-linux | |
| docker manifest push ghcr.io/lucernae/devcontainer-nix:base--${{matrix.nix_channel}} |