nixos-runner/.forgejo/workflows/publish.yaml

50 lines
1.3 KiB
YAML
Raw Normal View History

2025-02-06 15:27:53 +01:00
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: |
2025-02-06 16:04:55 +01:00
echo "pkgs-name=${{ matrix.container }}-${{ matrix.version }}" | tr -d . >>"${GITHUB_OUTPUT}"
2025-02-06 15:27:53 +01:00
- name: build
2025-02-06 16:03:46 +01:00
uses: actions/nix/build@main
2025-02-06 15:27:53 +01:00
with:
package: ${{ steps.pkgs.outputs.pkgs-name }}
out-link: ${{ steps.pkgs.outputs.pkgs-name }}
2025-02-06 22:58:51 +01:00
- name: load image into podman
2025-02-06 15:27:53 +01:00
run: |
2025-02-06 23:13:55 +01:00
podman load < ${{ steps.pkgs.outputs.pkgs-name }}
2025-02-11 00:56:26 +01:00
publish:
runs-on: nixos-latest
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}"