nixos-runner/.forgejo/workflows/publish.yaml
Julian Stiller fa434ee76e
Some checks failed
build and publish containers / build (nixos, 24.11) (push) Successful in 5m34s
build and publish containers / build (nixos, unstable) (push) Successful in 5m32s
build and publish containers / publish (nixos, 24.11) (push) Failing after 26s
build and publish containers / publish (nixos, unstable) (push) Failing after 20s
Actions: make publish depend on build
2025-02-11 00:59:48 +01:00

50 lines
1.3 KiB
YAML

name: build and publish containers
on:
push:
branches:
- main
schedule:
- cron: "0 0 * * 1,3,5"
jobs:
build:
runs-on: nixos-latest
strategy: &strategy
matrix:
container: [ nixos ]
version: [ "24.11", "unstable" ]
steps:
- name: checkout
uses: actions/checkout@v4
with:
ref: 'main'
- name: nix package names
id: pkgs
run: |
echo "pkgs-name=${{ matrix.container }}-${{ matrix.version }}" | tr -d . >>"${GITHUB_OUTPUT}"
- name: build
uses: actions/nix/build@main
with:
package: ${{ steps.pkgs.outputs.pkgs-name }}
out-link: ${{ steps.pkgs.outputs.pkgs-name }}
- name: load image into podman
run: |
podman load < ${{ steps.pkgs.outputs.pkgs-name }}
publish:
runs-on: nixos-latest
needs: build
strategy: *strategy
steps:
- name: login to container registry
uses: https://code.forgejo.org/docker/login-action@v2
with:
registry: git.flyinggecko.org
username: flyinggecko
password: ${{ secrets.REGISTRY_TOKEN }}
- name: publish image
env:
IMAGE: git.flyinggecko.org/flyinggecko/oci-images/${{ matrix.container }}:${{ matrix.version }}
run: |
docker push "${IMAGE}"