mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-04-16 12:19:10 +00:00
31 lines
1017 B
YAML
31 lines
1017 B
YAML
name: "Build devcontainers"
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- develop
|
|
jobs:
|
|
build-devcontainers:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: DeterminateSystems/nix-installer-action@v16
|
|
- uses: DeterminateSystems/magic-nix-cache-action@v9
|
|
with:
|
|
extra-conf: |
|
|
keep-going = true
|
|
- name: Build
|
|
run: |
|
|
nix build -f ./devcontainers --print-out-paths --no-link > build_paths
|
|
env:
|
|
NIXPKGS_ALLOW_UNFREE: "1"
|
|
- name: Deploy devcontainers to GitHub registry
|
|
run: |
|
|
echo "${{ secrets.GITHUB_TOKEN }}" | skopeo login ghcr.io -u ${{ github.actor }} --password-stdin
|
|
|
|
for image_archive in $(< build_paths); do
|
|
CONTAINER_TAG=$(echo $image_archive | awk 'match($0, /docker-image-(\S+).tar.gz/, arr) {print arr[1]}')
|
|
skopeo copy \
|
|
"docker-archive:${image_archive}" "docker://ghcr.io/${{ github.repository }}"
|
|
done
|